Manipulating data streams in data stream processors

ABSTRACT

Techniques for performing user-configurable traffic management functions on streams of packets. The functions include multicasting, discard, scheduling, including shaping, and segmentation and reassembly. In the techniques, the functions are not performed directly on the packets of the stream, but instead on descriptors that represent stored packets. A packet&#39;s descriptor includes at least an identifier for the packet and a specifier for a set of traffic management functions to be performed on the descriptor. The user configures a set of traffic management functions for a traffic queue of descriptors. The specifier in the descriptor specifies a set of traffic management functions by specifying a descriptor queue. In multicasting, a descriptor is copied and placed on more than one traffic queue; with regard to discard, when the discard function associated with a traffic queue determines that a packet is to be discarded, the descriptor is placed in a discard traffic queue. Packets represented by descriptors in a discard traffic queue are discarded from the buffer. Output of descriptors from all traffic queues, including discard traffic queues, is scheduled. Scheduling is done using a hierarchy of schedulers. The form of the hierarchy and the scheduling algorithms used by the schedulers in the hierarchy are both user configurable. As disclosed, the techniques are implemented in a traffic management coprocessor integrated circuit. The traffic manager coprocessor is used with a digital communications processor integrated circuit that performs switching functions. The buffers for the packets are in the digital communications processor. Also disclosed are a modified partial packet discard algorithm and a frame based deficit round robin scheduling algorithm.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This patent application claims priority from U.S. Provisional PatentApplication 60/283,746, filed Apr. 13, 2001.

BACKGROUND

1. Field of the Invention

The invention relates generally to the processing of streams of digitaldata in devices such as packet switches and routers and morespecifically to processing such as multicasting packets to a number ofstreams, discarding packets in a stream, and scheduling, includingshaping output streams and segmenting or reassembling them.

2. Description of Related Art: FIG. 1

Packets and Protocols

Communication among digital systems is generally by means of packets. Apacket is shown at 113 in FIG. 1. A packet is simply a sequence of bitswhose meaning is determined by a protocol. The protocol defines how thedigital devices which-process the packet are to interpret the bits inthe packet. Regardless of protocol, most packets have a header 115,which indicates how that particular packet is to be processed accordingto the protocol, and a payload 117, which is the actual informationbeing communicated by the packet. A packet may also have a trailer 119,which may simply indicate the end of the packet, but may also containinformation which permits detection and/or correction of errors thathave occurred during transmission or processing of the packet. Dependingon the protocol which defines it, a packet may have a fixed length or avarying length. In the following discussion, the contents of the header115 and trailer 119 will be termed protocol data, since the manner inwhich these contents are interpreted is determined completely by theprotocol, and the contents of payload 117 will be termed payload data.Packets for certain protocols are often termed frames or cells.

Packets are used for communication in digital systems at many differentlevels. Thus, the payload of a group of packets at one level of thedigital system may be a packet at a higher level. That is shown at 137in FIG. 1. IP packet 121 is a packet which is interpreted according tothe IP protocol. IP packets 121 have an IP header 123 and avarying-length IP payload 125. Included in the information in IP header123 is the length of IP payload 125. When IP packet 121 is transportedacross a physical network, it is carried in the payload of a stream 135of transport packets 127. Each transport packet 127 has its own header129, payload 131, and trailer 133. What are termed transport packetsherein are packets at the link layer of the ISO seven-layer model.Transport packets may have fixed or varying lengths, depending on theprotocol used in the link layer.

The devices that deal with the transport packets do so as indicated byheader 129 and trailer 133 in the packets, and do not examine thecontents of payload 131. When a transport packet reaches itsdestination, the payload is passed to the part of the system for whichit is intended, in this case, a component which operates according tothe IP protocol, and this component deals with IP packet 121 asindicated in IP header 123. Of course, IP payload 125 may be a packetfor another, still higher level. For example, it may be a packetdestined for a decrypter, and the payload of that packet may be anencrypted IP packet 121. In such a case, the component that deals withIP packet 121 passes the payload to the decrypter, which decrypts theencrypted ]P packet 121 and returns the decrypted IP packet to thecomponent that deals with IP packets for further processing. Thatprocessing may of course include sending the decrypted IP packet toanother destination, and if communication with that destination is viathe protocol for transport packets 127, the component that deals with IPpackets will provide the decrypted IP packet to the component thatproduces transport packet streams and the decrypted IP packet will becarried in the payload of the transport packets 127.

Packet Switches

When packets are used to communicate between digital systems that arelocated remotely from each other, the packets move on digital networksthat connect the systems. At the physical level, the digital network mayemploy any medium to transmit a signal between two devices, for example,the ether, a conducting wire, or an optical cable. Packets are routedamong transmission paths by packet switches. The packet switch routesthe packet according to information that is typically contained in thepacket header.

As one would expect, each kind of protocol has its own routing rules.For example, the IP protocol uses logical routing; each source ordestination of an IP packet has a logical IP address, and an IP packetintended for a given destination has that destination's logical IPaddress in its header. The header does not indicate the physicallocation of the destination. The IP packet switch must translate the IPaddress into a physical address that will get the packet at least partof the way to its destination and must also make a stream 135 oftransport packets directed to that physical address that carry the IPpacket as their payload 131. Thus, IP node 109(n) is on Ethernet node107(n) on Ethernet LAN 105(a) and an IP packet switch that is connectedto LAN 105(a) must respond to an IP packet addressed to IP node 109(n)by making a stream of Ethernet packets directed to Ethernet node 107(n)that carry the IP packet as their payload.

A typical packet switch is shown at 103. Packet switch 103 is connectedto a number of physical media 106, by means of which packet switch 103may receive and transmit data. Examples of such media may be fiber opticcables or cables made up of electrical conductors. Each such medium 106has its own protocol for defining the data sent via the medium; forexample, one widely-used protocol for sending data via an optical cableis the SONET protocol. In FIG. 1, media 106(a . . . m) are opticalcables using the SONET protocol, while media 106(n . . . z) areelectrical cables. Packets at the level of the medium, termed hereinmedium packets, have as their payload transport packets. In terms of theISO 7-layer model, the medium packets are physical-layer packets. Inswitch 103, the transport packets that are sent and received on theoptical cables are packets made according to the ATM protocol used inATM wide-area network 111, while the transport packets that are sent andreceived on the electrical cables are made according to the Ethernet™protocol used in local area networks 109. In many cases, the transportpackets have IP packets as their payloads, and in those cases, packetswitch 103 routes the IP packets to IP nodes 109. As described above, itdoes so by determining the medium 106(i) upon which the IP packet shouldmove to reach its destination and then making a stream of packetsaccording to the protocol required for the medium that have thetransport packet stream used with that medium as their payloads, andthese in turn have the IP packet as their payload. Thus, if packetswitch 103 receives an IP packet from WAN 111 that is directed to IPnode 109(n) and IP node 109(n) is in Ethernet node 107(n) on EthernetLAN 105(a), packet switch 103 must make a stream of packets in the formrequired by medium 106(n) whose payload is a stream of Ethernet packetsdirected to Ethernet node 107(n) that in turn carry the IP packet astheir payload.

The functions performed by a packet switch 103 depend on the networkenvironment in which the packet switch is operating and the capabilitiesof the packet switch. The functions that are important for the followingdiscussion will be termed herein traffic management functions. There arethree general groups of traffic management functions:

routing packets received from a particular source to one or moredifferent destinations.

transforming packet streams as required for the routing.

controlling traffic, so that neither switch 103 nor the devices ittransmits data to is overwhelmed and so that switch 103 and the networksit serves are fairly and efficiently utilized.

Continuing with these functions in more detail, routing includesfiltering and multicasting. Filtering is performed at networkboundaries. Packet switch 103 is shown here as being at the boundarybetween a private network 104 and a public network 102. The header ofeach IP packet 121 contains the source IP address and destination IPaddress for the packet, and the security policies of private network 104bar access by IP packets from public network 102 with certain sourceaddresses to private network 104 and also bar access by packets fromprivate network 104 with certain source addresses to public network 102.Switch 103 filters each incoming IP packet by comparing its sourceaddress with a list of source addresses which are to be barred, and ifthe incoming packet is on the list, it is discarded. Switch 103 filtersoutgoing packets in a similar fashion. Multicasting is sending copies ofa packet received from a source to multiple destinations.

Stream transformation includes operations such as the one describedabove of transforming an IP packet that is received as a stream of ATMtransport packets into an IP packet that is output to it its destinationas a stream of Ethernet transport packets. Such operations typicallyinvolve reassembling the higher-level packet from the payloads of itstransport packets when the higher-level packet is received in the switchand segmenting the higher-level packet into transport packets when it istransmitted from the switch. Stream translation also includes encryptionand decryption of payloads. One place where encryption or decryptionoccurs is at network boundaries. For example, a security policy ofprivate network 104 may require that IP packets sent to certaindestinations in public network 102 be encrypted, and the encryption maybe done in switch 103. Switch 103 may also decrypt packets coming fromthose destinations when they enter private network 104.

Controlling traffic includes protecting switch 103 and destinationsdownstream of it from being overloaded by discarding packets andscheduling output of packets from switch 103 so that output bandwidth isefficiently used and so that to the extent possible, the requirements ofeach output stream with regard to network resources and timing can besatisfied. The requirements of an output steam in this regard are calledits service class. The packet switch must be able to handle serviceclasses ranging from e-mail where all that is required is that thee-mail arrive at a reasonable time (measured in hours) after it has beenposted through digital TV, in which the packets must arrive at theirdestination within fixed time intervals of each other, to packettelephony, where there are strict constraints not only on the timeintervals between packets, but also on the total length of time it takesa packet to traverse the network from its source to its destination.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram of a packet network and packets;

FIG. 2 is a block diagram of a digital communications processor whichemploys look-aside data stream management and a traffic managementprocessor that is used with the digital communications processor;

FIG. 3 is a conceptual overview of traffic management processor 203;

FIG. 4 is an overview of a traffic queue 204 and data structuresassociated therewith;

FIG. 5 is a diagram showing a scheduler hierarchy;

FIG. 6 is a detailed diagram of the format of the enqueue data message;

FIG. 7 is a detailed diagram of the format of the dequeue data message;

FIG. 8 is a detailed diagram of the format of traffic queue parameterblock 403;

FIG. 9 is a detailed diagram of the format of multicast elaborationtable 421;

FIG. 10 is a detailed diagram of the format of discard configurationblock 431;

FIG. 11 is a detailed diagram of the format of buffer pool specification433;

FIG. 12 is a detailed flowchart of a discard operation;

FIG. 13 is a detailed diagram of the format of a commit enqueue datamessage;

FIG. 14 is a diagram of the primitives from which schedulers may beconfigured in a preferred embodiment;

FIG. 15 is a block diagram of a presently-preferred implementation ofsystem 201;

FIG. 16 is a detailed block diagram of TMC IC 1503;

FIG. 17 is a detailed block diagram of a configuration of externalmemory in TMC IC 1503;

FIG. 18 is a table showing example external memory configurations in TMCIC 1503;

FIG. 19 is a detailed view of the signals on TMI bus 1507;

FIG. 20 shows timing diagrams for signals on TMI bus 1507;

FIG. 21 is a detailed diagram of a traffic class scheduler 503;

FIG. 22 is a detailed diagram of an interior scheduler 509;

FIG. 23 is a detailed diagram of the data structure used to configure ascheduler;

FIG. 24 is a detailed diagram of the data used to define a schedulerinput;

FIG. 25 is a high-level block diagram of TMC 203 and QMU 211; and

FIG. 26 is a detailed block diagram of a traffic class scheduler thatemploys a frame-based deficit round robin scheduling algorithm;

FIG. 27 is a diagram of the data structure that configures a virtualoutput port 521;

FIG. 28 is a diagram of a dequeue acknowledge message;

FIG. 29 is a diagram of a data structure that is used to configure atraffic class scheduler 503; and

FIG. 30 is a diagram of the data structure used to relate traffic queues204 to input scheduler queues for traffic class schedulers 503.

FIG. 31 is a continuation of FIG. 6;

FIG. 32 is a continuation of FIG. 7;

FIG. 33 is a further continuation of FIG. 7;

FIG. 34 is a continuation of FIG. 8;

FIG. 35 is a continuation of FIG. 9;

FIG. 36 is a continuation of FIG. 23;

FIG. 37 is a continuation of FIG. 24;

FIG. 38 is a continuation of FIG. 20;

FIG. 39 is a further continuation of FIG. 20;

FIG. 40 is a continuation of FIG. 30; and

FIG. 41 is a further continuation of FIG. 30.

Reference numbers in the drawing have three or more digits: generally,the two right-hand digits are reference numbers in the drawing indicatedby the remaining digits. Thus, an item with the reference number 203first appears as item 203 in FIG. 2. Exceptions to this rule areindicated in the following table:

Reference Numbers Figures  6xx 6, 31  7xx  7, 32, 33  8xx 8, 34  9xx 9,35 20xx 20, 38, 39 23xx 23, 36  24xx 24, 37  30xx 30, 40, 41

DESCRIPTION OF THE DRAWINGS

The following Detailed Description begins with an overview of anenvironment in which the techniques disclosed herein may be practicedand then presents a detailed disclosure of a traffic manager thatpractices the technique, and finally presents an implementation of thetraffic manager that employs a traffic manager integrated circuit andexternal memory ICs.

Look-Aside Data Stream Manipulation

The techniques for data stream manipulation disclosed herein arepracticed in an environment that employs look-aside data streammanipulation. In look-aside data stream manipulation, a packet's payloadis received from a network input and stored until it is output to anetwork output. When the packet is received, a descriptor is made thatrepresents the packet; as the term is used herein, a descriptor includesan identifier for the stored payload and additional information whichcontrols the manner in which the environment manipulates the packetstream to which the payload belongs. Manipulation of the data stream isdone using the descriptor instead of the packet it represents. Forexample, switching a packet from an input to an output is done byplacing the descriptor on a queue that is serviced by the output; whenthe descriptor reaches the head of the queue, the output uses themanipulation information and the payload descriptor to output thepayload associated with the descriptor in the form required for theoutput. Other operations such as multicasting, rate policing, discarddue to congestion, scheduling, or segmentation and reassembly aresimilarly performed in whole or in part by manipulating descriptorsrather than payloads.

An Environment for Look-Side Data Stream Manipulation: FIG. 2

FIG. 2 shows an environment 201 in which look-aside data streammanipulation is practiced. Environment 201 has two main components: adigital communications processor (DCP) 202 which manipulates descriptorsseparately from the payloads they represent and a traffic managementcoprocessor (TMC) 203 which performs higher-level data streammanipulation tasks such as multicasting, rate policing and discard,scheduling, shaping, and reassembly and segmenting for digitalcommunications processor 202. In one embodiment, DCP 202 and TMC 203 areimplemented as integrated circuits with additional external memory IC's;in other embodiments, they may not be so implemented, and in others, TMC203 may be integrated with DCP 202. One example of an IC implementationof DCP 202 is the C-5™, available from C-Port Corporation, 120 WaterSt., Andover, Mass. 01845. A prototype implementation of the C-5 isdescribed in detail in published PCT patent application WO 99/59078,C-Port Corporation, Digital Communications Processor, published 18 Nov.1999.

Continuing in more detail with DCP 202, DCP 202 receives data streamsfrom one or more networks at inputs 219(0 . . . m) and transmits datastreams to one or more networks at outputs 225(0 . . . p). The internalcomponents of DCP 202 which are of interest in the present context arethe following:

channel processors, which process data streams. The channel processorsinclude

receive processors 221, which process the data streams received oninputs 219(0 . . . m) and

transmit processors 223, which process the data streams beingtransmitted to outputs 225 (0 . . . p).

Channel processors may also be used to process payloads internally toDCP 202.

buffer management unit 227, which stores the payloads received viainputs 219(0 . . . m) in payload buffers 229 until they are output viaoutputs 225(0 . . . p).

queue management unit 211, which stores queues 213 of descriptors.

The channel processors are configurable to deal with different kinds oftransport packets and physical layer data representations. Descriptorsare made and read by the channel processors. In most cases, a descriptorrepresents a payload stored in buffer management unit 227 and containsan identifier for the payload buffer 229(i) that contains the payloadthe descriptor represents. As long as a descriptor remains within DCP202, its contents are determined solely by the needs of the channelprocessor which makes the descriptor and the channel processor thatreads it. Descriptors that remain within DCP 202 are termed in thefollowing channel processor descriptors. One such descriptor is shown at214. When a descriptor is to be processed by TMC 203 as well as thechannel processors, the descriptor must contain additional informationfor use by TMC 203. Descriptors which contain such additionalinformation are termed TMC descriptors 216 in the following.

The manner in which the components of DCP 202 interact to process a datastream may be demonstrated with the example of receiving an IP packetfrom a network that uses ATM packets as transport packets and has anoptical physical layer and outputting the IP packet to a network thatuses Ethernet packets as transport packets and has an electronicphysical layer. Received stream 219(i) is received in a receiveprocessor 221(i) that has been configured to handle data streams thathave an optical physical layer and an ATM transport layer and to processIP packets. As receive processor 221(i) receives stream 219(i), itextracts the IP packet payload from the stream, writes the IP packetpayload to a payload buffer 229(j) in buffer management unit 227, andretains an identifier for payload buffer 229(j). The identifier isplaced in a channel processor descriptor 214(k). The descriptor mayadditionally contain other protocol data from the IP packet. Receiveprocessor 221(i) further processes the address information in the IPpacket's header to determine what descriptor queue(s) 213(l) in queuemanagement unit 211 the descriptor for the IP packet should be placed inand places the descriptor 214(k) at the tail of the queue. This queue213(l) is read by transmit processor 223(j) that outputs to the desirednetwork. Transmit processor 223(l) has been configured to output the IPpacket using an Ethernet transport layer and an electronic physicallayer. When descriptor 214(k) reaches the head of queue 213(l), transmitprocessor 223(j) uses the information in descriptor 214(k) to locatebuffer 229(j) and outputs the payload as an IP packet using the propertransport layer and physical layer.

Traffic Management in Environment 201

As will be apparent from the above description of the operation of DCP202, DCP 202 has sufficient resources of its own for only the simplesttraffic management functions. It can route a data stream received at aparticular input 219(i) to a particular output 219(j) and can transformthe data stream as required for this routing. Recirculation capabilitiesin the channel processors further permit data stream transformationssuch as encryption and decryption. There are, however, not sufficientresources in DCP 202 for performing “higher” traffic managementfunctions for which knowledge of the state of DCP 202 itself or of therequirements of devices in the networks connected by DCP 202 isrequired. Examples of such functions are packet discard, scheduling,shaping, and packet reassembly and segmentation.

In environment 201, such higher traffic management functions areperformed by traffic management coprocessor 203, which, in a preferredembodiment is an IC that has external memory and is designed to workwith the IC embodiment of DCP 202. When DCP 202 is used with a TMC 203,queue management unit includes not only local queues 245 that are usedas described above by DCP 202, but also a queue 243 for TMC descriptors216 that are to be sent to TMC 203 and one or more queues 247 fordescriptors received from TMC 203. When a data stream being processed byDCP 202 requires one or more higher traffic management functions, thereceive processor 221(i) that is receiving the data stream provides aTMC descriptor 216 to QMU 211 to be added to the tail of queue 243.Coprocessor 203 places this TMC descriptor 216(i) in a traffic queue204(m) for its data stream and often other data streams whose trafficmust be managed together with the data stream with which descriptor216(i) is associated. The traffic queue a TMC descriptor is placed indetermines what TMC 203 does with the descriptor and how it does it.Seen broadly, a traffic queue thus relates a set of descriptors to a setof traffic management functions in TMC 203; as will be seen in moredetail later, a traffic queue also relates a set of descriptors to a setof packet processing functions in DCP 202.

There are two general classes of traffic queues: non-discard trafficqueues 249 for descriptors for packets that are not to be discarded byDCP 202 and discard traffic queues 251 for descriptors for packets thatTMC 203 has determined ought to be discarded. TMC 203 reads a TMCdescriptor 216 from the head of a particular traffic queue 204(m), addsinformation needed by QMU 211 to process the TMC descriptor 216, makingthe TMC descriptor into a QMU descriptor, and provides the QMUdescriptor to queue management unit 211, as shown at 207. Queuemanagement unit 211 then places the cp descriptor contained in the QMUdescriptor at the tail of descriptor queue 213(n) for the furtherprocessing that needs to be done in DCP 202 for the packet representedby the descriptor. As will be explained in more detail later, inputs ofdescriptors to TMC 203 and outputs of descriptors from TMC 203 are flowcontrolled. In the latter case, the flow control not only controls flowfrom TMC 203 to QMU 211, but flow of descriptors to individual queues213 in queues 247.

For example, if the traffic queue is a discard traffic queue, queuemanagement unit 211 places the descriptor in a queue 213 that isserviced by a channel processor that does the processing necessary todiscard the packet represented by the queue from buffer management unit227. If, on the other hand, the traffic queue is a non-discard trafficqueue, queue management unit 211 may put the descriptor in thedescriptor queue 213 for a transmit processor 223(j) that is outputtingthe stream to transmitted stream 225(i). Since any one of the transmitor receive processors in DCP 202 can read descriptors from and writedescriptors to the queues managed by QMU 211, arbitrarily complexinteractions between coprocessor 203 and DCP 202 are of course possible.Examples of such complex interactions will be given in due course.

Traffic management coprocessor 203 can apply a number of differenttraffic management techniques to a traffic queue 204. How the techniquesare applied is highly configurable with regard to each traffic queue204. The information which determines what traffic management techniquesare applied to a traffic queue 204(i) is contained in traffic managementinformation 235. In logical terms, traffic management information 235falls into three categories:

traffic management definitions 237, which define the availabletechniques. In a preferred embodiment, these definitions are built intoTMC 203; in other embodiments, the user may be able to modifydefinitions 237 or add new definitions.

traffic management configuration data 239, which defines how thetechniques defined at 237 are to be applied to sets of traffic queues204; and

current traffic management state 241, which contains the current stateof each traffic queue 204 and of other components of TMC 203 and DCP 202which are relevant to traffic management.

Traffic management is done in TMC 203 by applying the traffic managementdefinitions 235 as configured by configuration data 239 to the currenttraffic management state 241 to select a traffic queue 204, and thepayload associated with the TMC descriptor 216 at the head of theselected traffic queue is treated as required by the traffic managementdefinitions, the configuration, and the current traffic managementstate.

Logical Overview of TMC 203: FIG. 3

FIG. 3 shows a logical overview of the components of traffic managementcoprocessor 203. In a preferred embodiment, there are two majorsubdivisions of TMC 203: processing components 306, which may beembodied in one or more processing elements, and TMC memory 307. In apreferred embodiment, all of the processing components 306 areimplemented in a single IC. Processing components 306 fall into threefunctional groups: enqueue processor 301, traffic queue processor 305,and dequeue scheduler 303. Enqueue processor 301 receives a TMCdescriptor 216 from QMU 211 and determines what traffic queue(s) thedescriptor is to be placed in. Part of this task is determining whetherthe descriptor and the packet it represents are to be discarded. If thedescriptor is to be discarded, enqueue processor 301 specifies that itbe placed in a discard traffic queue. Traffic queue processor 305receives the descriptor 216 from enqueue processor 301 and links thedescriptor 216 into the traffic queue 204 specified by enqueue processor301. Dequeue scheduler 303 determines the next traffic queue 204 fromwhich a descriptor 216 shall be provided to QMU 211 and provides thedescriptor which is at the head of that traffic queue to QMU 211. In apreferred embodiment, all three of these processors operate in parallel,thereby permitting pipelined processing of descriptors.

In a preferred embodiment, TMC memory 307 includes both memory which isinternal to the IC in which the processors 306 are implemented andmemory which is external to that IC. In other embodiments, thedistribution of memory between the IC and external memory may vary. Infunctional terms, the memory is divided into storage for tm definitions237, tm configuration data 239, and current tm state 241. The functionsof the contents of these parts of memory 307 have already been explainedin overview.

There are three broad classes of content in TMC memory 307: schedulerinformation 333, which is used in scheduling, TQ enqueuing information335, which is used to enqueue descriptors 216 into traffic queues 204,and multicast information 337, which is used in multicasting. Continuingin more detail, there are three broad classes of tm definitions 237 in apreferred embodiment: scheduling algorithms 309, which specifytechniques for selecting the next descriptor 216 to be provided to DCP202; traffic queue enqueuing algorithms 311, which specify techniquesfor determining whether a TMC descriptor 216 received from DCP 202 is tobe discarded; and multicast algorithm 315, which describes how a singleTMC descriptor 216 is to be copied to multiple traffic queues. There isconfiguration data 239 corresponding to each of the classes ofdefinitions. Scheduler configurations 317 define individual schedulersand the manner in which the schedulers are arranged in a schedulerhierarchy; traffic queue enqueuing configurations 319 define theconditions under which discards will be made; elaboration tables 323specify what traffic queues a descriptor for a packet that is to bemulticast is to be placed on. Additionally, there is configuration data327 for each traffic queue 204. Configuration data 239 may be set by auser of TMC 203 to determine what TM definitions will apply to aparticular traffic queue and the manner in which these definitions willbe applied. To give an example, a discard configuration in TQ processingconfigurations 319 will specify parameters that determine the conditionsunder which a descriptor 216 will be discarded instead of being placedat the tail of a particular traffic queue 204. In a preferredembodiment, the configuration data 239 may be set only when TMC 203 isinitialized; in other embodiments, dynamic setting of the configurationdata 239 may be permitted.

Current tm state 241 contains data which specifies the current state ofeach of the traffic queues 213 and of schedulers in the schedulerhierarchy. Included in current TM state 241 are current traffic queuestate 329 and current scheduler state 318. Current traffic queue state329 includes the descriptors 216 currently contained in each queue, thesize of the packets represented by the descriptors in the queue, and thecurrent state of the payload buffers 229 in which the packets arestored. The size of the packets and the current state of the payloadbuffers 229 are used to determine whether a descriptor 216 should bediscarded instead of being placed on a traffic queue 204 and whichtraffic queue 204 is selected next by dequeue scheduler 303. Currentscheduler state 318 determines which TMC descriptor 216 is selected foroutput to DCP 202 by dequeue scheduler 303.

General Operation of TMC 203: FIG. 25

FIG. 25 is a block diagram showing how the components of TMC 203 and ofQMU 211 interact to schedule a cp descriptor 214's arrival in adescriptor queue 213 being used by a transmit processor 223 and therebyto schedule output of the payload represented by the descriptor by atransmit processor 223.

As already indicated, a channel processor which is making a TMCdescriptor 216 that is to be scheduled by TMC 203 must add additionalinformation to the cp descriptor 214. Effectively, the channel processorencapsulates the cp descriptor 214, as shown in the detail of TMCdescriptor 214 by adding TMC information 2513 to it. Similarly, when TMC203 returns the cp descriptor 214 to QMU 211, it encapsulates it byadding BMU information 2515 to it, as again seen in the detail of BMUdescriptor 2508. At a minimum, TMC information 2513 includes

an identifier for a traffic queue 204 in TMC 203; and

when the descriptor represents a varying-length packet, the length inbytes of the packet represented by the descriptor 213.

Additional information may be required for certain operations performedby TMC 203. QMU information 2515 includes at a minimum a virtual outputport identifier that QMU 211 uses to determine which of descriptorqueues 247 the encapsulated cp descriptor 214 is to be placed in. Ofcourse, which of the descriptor queues 247 the encapsulated cpdescriptor 214 is placed in determines the manner in which the packetrepresented by descriptor 214 is further processed in DCP 202.

FIG. 25 further shows the architecture of TMC 203 and the interfacebetween QMU 211 and TMC 203 at a level of detail greater than that ofFIG. 3. As shown in FIG. 25, QMU 211 sends the TMC descriptor at thehead of TMC input queue to TMC 203 via an enqueue data message 601 whichcontains descriptor 216. When TMC 203 receives the enqueue data message,it places the descriptor 216 from the message in the tail of input queue2501.

Enqueue processor 301 reads TMC descriptors 216 from the head of inputqueue 2501. If the descriptor 216 indicates that the packet itrepresents is to be multicast, enqueue processor 301 uses multicastinformation 327 to determine which traffic queues 204 are to receivecopies of the descriptor 216. Otherwise, TMC descriptor 216 directlyspecifies the traffic queue that is to receive the descriptor 216. Whenenqueue processor 301 knows what traffic queue 204 a descriptor 216 isto be placed in, it uses TQ enqueue information 335 to determine whetherthe state of the traffic queue requires the descriptor 216 and thepacket represented by the descriptor to be discarded. When that is thecase, enqueue processor 301 substitutes a discard traffic queue in DTQS251 for the traffic queue originally specified in TMC descriptor 216.When enqueue processor 301 has finally determined the traffic queue 204that is to receive descriptor 216, enqueue processor 301 provides thedescriptor 216 to traffic queue processor 305 for enqueuing at the tailof the traffic queue specified by enqueue processor 301.

For scheduling purposes, traffic queues 204 in TMC 203 are organizedinto scheduler queues, shown at 523 in FIG. 25. A scheduler queue 523contains a queue of traffic queues 204. Dequeue scheduler 303 usesscheduler information 333 to select one of a set of non-empty schedulerqueues 523 for scheduling. When dequeue scheduler 303 has selected ascheduler queue 523 for scheduling, the traffic queue 204(i) that iscurrently at the head of the selected scheduler queue 523 is serviced,that is, the descriptor 216 that is currently at the head of trafficqueue 204(i) is output as a QMU descriptor 2508 to output queue 2507.From there, TMC 203 outputs the QMU descriptor 2508 as a dequeue datamessage 701 to QMU 211. QMU 211 places the descriptor 2508 in TMC outputqueue 2509, and then places the cp descriptor 214 contained in the QMUdescriptor 2508 in the proper descriptor queue 213 in queues 247.

Continuing in more detail with scheduling, traffic queue processor 305is responsible for placing traffic queues 204 in the scheduler queues523 and removing them from scheduler queues 523. A traffic queue 204 maybe at the head of a scheduler queue 523 only if the traffic queue can beserviced. A traffic queue that can be serviced is termed herein aneligible traffic queue. Empty traffic queues are of course not eligible.Other situations in which a traffic queue 204 is not eligible will bedisclosed in detail in the following. If a traffic queue 204 is notpresently eligible, traffic queue processor 305 does not place it in ascheduler queue, but instead leaves it in a set of ineligible trafficqueues 2511. A traffic queue 204 may also become ineligible between thetime it is placed in the scheduler queue 523 and the time it would beserviced. In that case, traffic queue processor 305 removes theineligible traffic queue 204 from the head of scheduler queue 523 beforeit is serviced, returning it to ineligible traffic queues 2511. Ascheduler queue 523 that has an eligible traffic queue at its head istermed an active scheduler queue. Dequeue scheduler 303 schedules onlyactive scheduler queues.

As mentioned above, QMU descriptor 2508 includes a virtual output portidentifier which associates the descriptor with a queue 213 indescriptor queues 247. One of the tasks of dequeue scheduler 303 is toassociate each QMU descriptor 2508 with the proper virtual output port.How this is done will be described in detail in the following. Thevirtual output port mechanism is also used to flow control the operationof dequeue scheduler 303 at the level of the descriptor queues 213 inqueues 247. Each virtual output port is associated with a credit valuewhich indicates how many cp descriptors 214 the descriptor queue 213 indescriptor queues 247 that corresponds to the virtual output port willcurrently accept for enqueuing. If the credit value is 0, dequeuescheduler 303 does not schedule scheduler queues which will output QMUdescriptors 2508 intended for the descriptor queue associated with thevirtual output port. Every time dequeue scheduler 303 schedules ascheduler queue that outputs a descriptor intended for a given outputport, the credit value is decremented; every time a cp descriptor 214 isremoved from a descriptor queue 213 in queues 247, QMU 211 sends adequeue acknowledgement message 1925 to TMC 203 that specifies thevirtual output port corresponding to the descriptor queue and dequeuescheduler 303 responds to message 1925 by incrementing the virtualoutput port's credit value. A scheduler queue 523 that is active and isnot barred from being scheduled by a virtual output port with a creditvalue of 0 is termed a schedulable scheduler queue. Thus, dequeuescheduler 303 selects the descriptor queue for output to QMU 211 that isat the head of an eligible traffic queue 204(i) that is in turn at thehead of an active and schedulable scheduler queue 523(j). It should alsobe pointed out here that as long as removing the descriptor from thehead of traffic queue 204(i) that is at the head of scheduler queue523(j) does not render traffic queue 204(i) ineligible, traffic queue204(i) goes to the end of scheduler queue 523(j). An active schedulerqueue thus serves its eligible traffic queues in round robin order.Additionally, traffic queue processor 305 may add descriptors 216 totraffic queues while the traffic queues are in scheduler queues 523.

As mentioned above, discarded descriptors are placed in discard trafficqueues that are scheduled like non-discard traffic queues. A QMUdescriptor 2508 from a discard traffic queue indicates that the packetrepresented by the descriptor 2508 is to be discarded and also indicatesthe reason for the discard. QMU 217 responds to a discard dequeue datamessage containing a descriptor from a discard traffic queue by placingthe descriptor 2508 in a queue for a channel processor in DCP 202 whichreturns buffer identifiers to buffer management unit 227 for reuse,thereby effectively discarding the contents of the buffer identified bythe buffer identifier.

FIG. 25 also gives an overview of the hardware interface between TMC 203and QMU 211 in a preferred embodiment. When there is room in input queue2501, TMC 203 asserts an input queue ready signal 1915 and QMU 211outputs the enqueue message at the head of TMC IQ 243 to TMC 203; whenthere is room in TMC output queue 2509, QMU 211 asserts an DQRDY signal1919 and TMC 203 outputs the QMU descriptor at the head of output queue2507. DQARDY 1923 and DQACK 1921 are used to acknowledge dequeuing ofdescriptors from descriptor queues 213 in queues 247. Each DQACK messagecontains the virtual output port specifier from a dequeue message whosecp descriptor 214 has just been dequeued by a channel processor from thedescriptor queue 213 in which it was placed after QMU 211 received itfrom TMC 203. As already described, TMC 203 uses the returned virtualoutput port specifiers to control flow of QMU descriptors 2508 to theirdestination descriptor queues 247.

Traffic Queues and Related Data Structures: FIG. 4

All of the activities of traffic management coprocessor 203 involvetraffic queues 204. The traffic queue a TMC descriptor is placed indetermines the discard policy that will be applied to the descriptor,the manner in which the descriptor will be scheduled, and the QMU queuethat the descriptor will be output to. FIG. 4 shows a traffic queue 204and its related data structures. Each traffic queue 204 has a trafficqueue identifier 423 and is defined by a traffic queue parameter block403. The TMC descriptors 216 belonging to the traffic queue are linkedtogether in a TMC descriptor queue 419; traffic queue parameter block403 has a tq head pointer 405 pointing to the head descriptor 216 inqueue 419 and a tq tail pointer 407 pointing to the tail descriptor 216in queue 419. The remaining information in parameter block 403 includesinformation about the current state of the traffic queue 204 representedby parameter block 403, information 411 used to determine whether adescriptor 216 should be added to the traffic queue or discarded,information 415 which is used in multicasting, and information 413 whichis used in scheduling the traffic queue.

The related data structures contain additional information that is usedin operations involving the traffic queue. When a packet is to bemulticast, its descriptor is placed in each traffic queue of a group oftraffic queues; the group is defined by a chain 422 of one or moremulticast elaboration tables 421. There is a tqid 423 in table 421 foreach traffic queue in the group. A given multicast table 421 isidentified by its metid 420. When a packet is to be multicast, its TMCdescriptor 216 contains the metid of the head multicast elaborationtable in MET chain 422 that specifies the group of traffic queues.

The decision whether to discard a descriptor is made using one ofseveral algorithms 311. Some of these take the state of buffers 229 inbuffer management unit 227 into account. That state information ismaintained in traffic management coprocessor 203 in terms of pools ofbuffers and sets of pools of buffers. The buffer pools and sets ofbuffer pools function as a model in TMC 203 of the state of certainbuffers in DCP 202. Each buffer pool for which TMC 203 maintains statehas a buffer pool specification 433 that specifies an amount of bufferspace in DCP 202; a traffic queue parameter block 403 specifies one suchbuffer pool specification. Each buffer pool specification 433(i)specifies a parent buffer pool specification for the set of buffer poolsthat the buffer pool represented by buffer pool specification 433(i)belongs to. Each buffer pool has a minimum amount of buffer spacereserved for it; the parent buffer pool specification indicates anamount of buffer space over and above the total of the minimum bufferspace for the buffer pools which is available to be shared among thebuffer pools belonging to the parent buffer pool.

Discard configuration block 431 contains the configuration informationfor the discard method used by the given traffic queue 204, and discardcode 432 is the code for the method. Discard configuration blocks 431are organized into an array 441 in TMC 203's memory, and a given trafficqueue 204(i) may select among 8 discard configuration blocks 431. Aswith buffer pool specifications 437, many traffic queue parameter blocks403 may specify a given discard configuration block 431. When adescriptor is to be added to the given traffic queue 204, theinformation in the buffer pool specifications 433 and 435 is usedtogether with information in discard configuration block 431 by discardcode 432 to determine whether the descriptor should be discarded. If thedescriptor is discarded, it is placed in a discard traffic queue 251.

The decision as to when the TMC descriptor 216 that is currently at thehead of a given traffic queue 204(i) is to be output to DCP 202 is madeusing a hierarchy of schedulers. Functionally, the hierarchy ofschedulers takes as its input a set of active and schedulable schedulerqueues 523 and selects one of the set as the source of a traffic queue204 whose head descriptor 216 is to be output to DCP 203. The manner inwhich the scheduler hierarchy selects scheduler queues thus determineshow much of the bandwidth of TMC 203 and ultimately of TMC-DCP system201 is available to the packets represented by the descriptors in thetraffic queues of the scheduler queues.

As shown at 430, in a preferred embodiment, a scheduler is defined by ascheduler configuration specifier 425 and by scheduler code 429 that isexecuted using the information in the scheduler configuration specifier.Scheduling info 413 in traffic queue parameter block 403 associates agiven traffic queue 204 with a single schedule configuration specifier425(i) belonging to a single scheduler 430; that scheduler defines atraffic class to which all of the traffic queues that have schedulerconfiguration specifiers 425 for the given scheduler 430 belong.Scheduler 430 is thus termed a traffic class scheduler 503. In apreferred embodiment, traffic class schedulers also handle segmentationand reassembly. A traffic class scheduler is a leaf scheduler in thescheduler hierarchy, and there must always be at least one otherinterior scheduler in the hierarchy, as indicated at 427 and 434 in FIG.4.

Scheduler Hierarchy: FIG. 5

FIG. 5 provides an overview of scheduler hierarchy 501. The input ofscheduler hierarchy 501 is a set of active scheduler queues 523; theoutput of scheduler hierarchy 501 is one of the set of active schedulerqueues 523. TMC 203 outputs a QMU descriptor 2508 containing the cpdescriptor 214 in the TMC descriptor 216 that is at the head of thetraffic queue 204 that is at the head of the scheduler queue that isoutput by scheduler hierarchy 501. Scheduler hierarchy 501 forms a treewhose nodes are traffic class schedulers 503 or interior schedulers 509.Each scheduler in the hierarchy takes a set of active scheduler queuesas its input and selects one of the input set as its output.

Hierarchy 501 is a tree. The leaf nodes of the tree are always trafficclass schedulers 503; the interior nodes are always interior schedulers509. A single interior scheduler at level 0 515 of the hierarchy formsthe root of the tree. When scheduler hierarchy 501 schedules a givenactive scheduler queue 523(i), the schedulers that schedule queue 523(i)form a path through the hierarchy from a traffic class scheduler 503 tothe root of the tree; one such path is marked with heavy arrows at 529in FIG. 5. The maximum depth of the hierarchy in a preferred embodimentis four schedulers.

As can be seen from FIG. 5, in a preferred embodiment, the rootscheduler 509(a) at level 0 can be configured to receive outputscheduler queues from up to 32 schedulers as inputs, and thus can havean input set of up to 32 scheduler queues; each interior scheduler atthe other levels can each be configured to have input scheduler queuesfrom up to 32 scheduler queues as inputs and can thus have input sets ofup to 32 scheduler queues; each traffic class scheduler 503 may have upto 32 scheduler queues as inputs and may thus have an input set of up to32 scheduler queues. The actual number of scheduler queues for a trafficclass scheduler 503 depends on the kind of traffic class scheduler.

An important difference between interior schedulers 509 and trafficclass schedulers 503 is that in a given traffic class scheduler 503(j),the input set of scheduler queues is active scheduler queues thatcontain traffic queues specifying traffic class scheduler 5039(j). In agiven interior scheduler 509(k), the input set of scheduler queues isthe scheduler queues that have been scheduled by the lower-levelschedulers which provide inputs to interior scheduler 509(k). Allscheduler queues that are available as inputs to interior schedulerqueue 509(k) will be active, but may not be schedulable by interiorscheduler queue 509(k). That is the case when a virtual output port 521is on an input to scheduler queue 509(k) and will not permit furtheroutputs of descriptors from the virtual output port to QMU 211.

When scheduler hierarchy 501 is in operation, each scheduler selects oneof its current set of active and schedulable input scheduler queues asits output. Thus, traffic class scheduler 503(c) selects one of itsactive scheduler queues 523 as its output, as does scheduler 523(d), andthese two scheduler queues, along with any others provided by schedulers503 that output to interior scheduler 509(c) and are not madeunschedulable by a virtual output port are the scheduler queues 523which are the input to interior scheduler 509(c); interior scheduler509(c) selects one scheduler queue 523 from among those input to it foroutput to interior scheduler 509(b), which in turn selects one schedulerqueue 523 from the ones input to it for output to root interiorscheduler 509(a). Root interior scheduler 509(a) selects one schedulerqueue 523 from its inputs, and the cp descriptor 214 in TMC descriptor216 at the head of the traffic queue 204 which is at the head of theselected scheduler queue is output in a QMU descriptor 2508. QMUdescriptor 2508 then is made into a dequeue data message 701 which goesto queue management unit 211 of DCP 202. Unless the traffic queue fromwhich the descriptor was taken has become ineligible, the traffic queue504 goes to the tail of its scheduler queue. If the traffic queue isineligible, it is removed from the scheduler queue and is not againplaced in a scheduler queue until it becomes eligible. As shown at 535in FIG. 501, ineligible traffic queues 204 remain associated with theirtraffic class schedulers 503; upon again becoming eligible, the trafficqueue is placed at the tail of one of the scheduler queues 523 thatserve as inputs to the traffic queue's traffic class scheduler.

Two levels of flow control in scheduler hierarchy 501 prevents TMCdescriptors 216 from being output to QMU 217 before QMU 217 can handlethem. One level deals with the inability of QMU 217 to handle any moredescriptors from TMC coprocessor 203 at all; this level operates at thehardware interface between TMC 203 and DCP 202; TMC coprocessor 203sends a descriptor to DCP 202 only when DCP 202 indicates that it isready to receive such a descriptor. The other level of flow controldeals with the situation where there is not enough room in a particulardescriptor queue 213 for additional descriptors from TMC 203. This levelof flow control is dealt with by virtual output ports 521 in hierarchy501.

Each path between a leaf scheduler 503 and root scheduler 509 inhierarchy 501 must have a virtual output port 521 and no path may havemore than one virtual output port 521. Each virtual output port has anidentifier which uniquely identifies it. A virtual output port 521 hastwo functions:

Each virtual output port relates a part of the output of schedulerhierarchy 501 to a descriptor queue 213 in descriptor queues 247 of QMU211.

Each virtual output port also indicates how many descriptors itscorresponding descriptor queue 213 can presently take.

The first function is performed by including an identifier for a virtualoutput port in each QMU descriptor 2508 that is output from TMC 203 toQMU 211. The identifier is that of the virtual output port 521 on thepath 529 through scheduler hierarchy 501 of the scheduler queue 523 thatincludes the traffic queue 204 to which the cp descriptor 214 in the QMUdescriptor 2508 belonged.

The second function is performed as follows: If the descriptor queue 213corresponding to the virtual output port 521 does not have room for thedescriptor(s) to be output from the traffic queue 204 at the head of thescheduler queue 523 selected by the scheduler for which the virtualoutput port controls output, the virtual output port 521 does not permitthe scheduler queue to be scheduled by the scheduler at the next levelof the hierarchy. When the corresponding descriptor queue 204 again hasroom, the virtual output port permits output to the next schedulinglevel. An active scheduler queue 523(i) is unschedulable when a virtualoutput port 521 j) on the path 529 between the traffic class scheduler503 which is the source of the active scheduler queue and the schedulerthat is presently scheduling scheduler queue 523(i) indicates that thedescriptor queue 213 corresponding to virtual output port 5210)currently has no room for an additional descriptor.

As mentioned in the discussion of traffic queues 204, there are twoclasses of traffic queues: discard traffic queues 251 and non-discardtraffic queues 249. Typically, the two classes are scheduled on separatepaths through hierarchy 501 to ensure that events which preventtransmission of the packets represented by a descriptor queue 213 thatis accepting descriptors from TMC 203 and thus result in blockage by avirtual output port 521 of a path through scheduler hierarchy 501 do notresult in the blockage of descriptors from discard traffic queues, sinceprocessing of descriptors from discard traffic queues is completelyinternal to DCP 202 and can continue regardless of the blockage of atransmitted stream 225. The form of hierarchy 501, the schedulingalgorithms of the schedulers 503 and 509 in the hierarchy, and theposition of virtual output ports 521 in the hierarchy are allconfigurable by users of TMC 203.

Details of Enqueue Data Messages: FIGS. 6 and 31

As described above, the TMC descriptors 216 which QMU 211 provides toTMC 203 are contained in enqueue data messages. FIGS. 6 and 31 show thedetails of an enqueue data message 601 in the preferred embodiment. Inthe preferred embodiment, the enqueue data message is made up of up to13 24-bit words. The length of enqueue data message 601 depends on thelength of a cp descriptor 214 which is contained in words 2-12 of theenqueue data message. In FIG. 6, there is a row for each field of theenqueue data message; column 603 indicates the word offset of the wordcontaining a field, column 605 indicates the field name, column 607indicates the bit position of the field in the word, and column 609describes the field's content and purpose. The rows for the fields areindicated at 611-627. It should be noticed that field 615 may containeither a tqid 423 or a metid 420, the latter being the case when thepacket represented by the descriptor is being multicast.

In general, the nature and purpose of the fields of enqueue data message601 are clear from FIGS. 6 and 31; the values for all of the fields buttype field 611 when it indicates no message come from TMC descriptor216; descriptor field 627 contains the cp descriptor 214 that isencapsulated in TMC descriptor 216. Further comment may be required withregard to speculative enqueuing and to discard priority field 625.Speculative enqueue is a mechanism for enqueuing a packet descriptor fora packet that has not yet been fully received by DCP 202. When thespeculatively enqueued packet has been fully received by DCP 202, asecond one-word long enqueue message called the committed enqueuemessage is transferred to TMC 203 to commit the speculative enqueue.Type field 611 in an enqueue message is used to identify a speculativeor committed enqueue message. Speculative enqueuing will be described inmore detail in the following. Discard priority field 625 is used toselect one of the up to 8 discard configuration blocks 431 associatedwith the traffic queue for which the TMC descriptor 216 is intended.

Details of Dequeue Data Messages: FIGS. 7, 32, and 33

FIGS. 7, 32, and 33 show the format of the dequeue messages 701 whichTMC 203 sends to buffer management unit 211. Each of these messagescontains a QMU descriptor 2508. As before, each field has a row, with603-609 indicating columns and 701-725 indicating rows. The purpose andcontent of most fields is clear from FIG. 7; with regard to discardreason field 723, this field is set when enqueue processor 301 discardsthe descriptor; when a QMU descriptor 2508 from a discard traffic queue251 is output to queue management unit 211, type field 703 and discardreason field 723 indicate that the payload of the packet represented bycp descriptor 214 in the QMU descriptor is to be discarded and why. Thecontents of the fields are divided into discard reasons to which DCP 202may need to respond by taking an action, in field 703, and reasons whichserve informational purposes, in field 723. Again, all of the fieldvalues in dequeue data message 701 except that of the idle message arecontained in QMU descriptor 208; field 725 contains the encapsulated cpdescriptor 214.

Details of Traffic Queue Parameter Block 403: FIGS. 8, and 34

FIGS. 8, and 34 show the format of traffic queue parameter block 403 ina preferred embodiment. The formats are represented as before, with801-809 indicating columns and 811-869 representing fields. Thedescriptions of the fields in column 809 are largely self-explanatory;in the following the fields will be related to the logical subdivisionsof FIG. 4.

Scheduling Info 413

The fields that provide this information include field 819, whichidentifies the traffic class scheduler 503(i) for the traffic queue 204represented by traffic queue parameter block 403, field 831, whichdetermines what scheduler queue 523(j) belonging to traffic classscheduler 503(i) the traffic queue 204 is to be placed in when it iseligible, and field 845, which contains information about the head TMCdescriptor 216 in traffic queue 204 that is used to determine whethertraffic queue 204 is eligible and if it is, how its scheduler queueshould be scheduled. The information varies with the kinds of packetsrepresented by the traffic queue 204's descriptors and with thescheduling algorithm used by scheduler queue 523(i). Two examples canserve here: with descriptors representing varying-length packets, field845 includes the packet's length; with descriptors representingfixed-length packets, field 845 includes an end-of-message indicator(eom) indicating whether the descriptor for the last packet in themessage being carried by the fixed-length packets has been received inthe traffic queue.

Multicast Info 415

In a preferred embodiment, TQ tag field 865 is an identifier thatspecifies a traffic queue 204 to QMU 211. The traffic queue is specifiedin two circumstances:

When the packet represented by cp descriptor 214 is being multicast, theidentifier specifies the traffic queue 204 in which enqueue processor301 placed this particular copy of the TMC descriptor 216; and

When the packet represented by cp descriptor 214 is to be discarded, theidentifier specifies the traffic queue 204 that was specified in the TMCdescriptor 216 containing the cp descriptor 214 when the TMC descriptorwas received in TMC 203.

Discard Info 411

Fields 813 and 814 identify discard configuration blocks 443 for thetraffic queue; these fields plus discard priority field 625 in TMCdescriptor 216 identify the actual discard configuration block 431 inblocks 443 to be used with a given descriptor. Fields 815, 816, 869, and827 all contain data used in various discard techniques.

Current tq State Info 409

This information is contained in field 836. That field containsinformation about the descriptor at the head of the traffic queue. Whatinformation is in the field depends on the kind of packet beingrepresented by the descriptor at the head of the traffic queue. If it isa varying-length packet, field 836 includes the packet's length; if itis a fixed-length packet, field 836 indicates the state of the packetwith regard to a multi-packet message: whether the last packet in themessage has arrived, and if it has, whether the packet represented bythe descriptor is the last packet in the message. In the preferredembodiment, each TMC descriptor 216 in the traffic queue has prependedto it a field like field 836 that contains the current TQ stateinformation for the next descriptor in the traffic queue.

Tq Head 405 and Tq Tail 407

These are implemented in fields 823 and 811, respectively. In thepreferred embodiment, the identifiers are simply pointers to thedescriptors. A feature of the design of TMC 203 is that to the extentpossible, pointers are manipulated rather than descriptors, trafficqueues, or scheduler queues.

Details of Operations Performed by TMC 203

In the following, examples of the operations performed by enqueueprocessor 301, traffic queue processor 305, and dequeue scheduler 303will be described in detail, beginning with the multicast operationperformed by enqueue processor 301. It is to be understood that theoperations may be performed in different ways in other embodiments.

Multicasting: FIGS. 9 and 35

A packet is multicast when it comes into a switching device at one inputpoint and is output at multiple output points. In system 201,multicasting may be done either in QMU 211 or in traffic managementcoprocessor 203; what is described here is multicasting in trafficmanagement coprocessor 203, where it is done by adding copies of a TMCdescriptor 216 received in an enqueue data message 601 to the trafficqueues 204 specified in a multicast elaboration table 421.

Multicast Elaboration Table Details

Details of the multicast elaboration table in a preferred embodiment areshown in FIGS. 9 and 35. Format is again a table, with each rowrepresenting a field of the table and columns 903-909 indicatinginformation about the fields. As already mentioned, TMC 203 maintainslinked lists of multicast elaboration tables 421; field 911 contains themetid 420 of the next multicast elaboration table 421 in the list. If agiven elaboration table 421 is the last one in the linked list, thatfact is indicated by the value of field 913. An elaboration table 421may specify up to 8 traffic queues to which copies of the descriptor maybe added. The entry for a single traffic queue is shown in detail at915; there are two fields that are of interest: 916, which contains atqid 423 for a traffic queue 204 and 917, which indicates the whetherthe contents of field 916 are valid. The remainder of the table, shownat 919, is traffic queue entries 915 for the remaining traffic queues.

When multiple copies of an enqueued descriptor are multicast elaboratedto multiple traffic queues destined for the same virtual output port,QMU 211 may need to be able to determine which traffic queue the copy ofthe descriptor came from. The field which identifies the traffic queueis traffic queue tag field 865 of the parameter block. The destinationtraffic queue's tag is placed in field 713 of each of the QMUdescriptors made from descriptors contained in the traffic queue.

Details of Processing a Multicast Enqueue Data Message

Whether an enqueue data message 601 is unicast or multicast is indicatedby field 619 of the enqueue data message. When field 619 indicatesmulticast, field 615 contains metid 420 for the first multicastelaboration table 421 in the MET chain to be used in the multicast.Multicast enqueue messages require extra processing time to performmulticast elaboration. The extra processing time requires that enqueuedata messages 601 be buffered up while they wait to be processed byenqueue processor 301. In general, enqueue processor 301 gives strictpriority to the processing of unicast enqueue data messages. There is,however, a user-configurable mechanism that guarantees that a fixedportion of the total number of descriptors processed by enqueueprocessor 301 will be multicast descriptors. The portion may beconfigured over a range extending from 1 of every 2 descriptorsprocessed to 1 of ever 256 descriptors processed. Multicast enqueuemessages that are waiting to be processed are stored in a buffer thatholds up to 32 multicast enqueue messages. If a multicast enqueuemessage is received and the multicast enqueue message buffer is full,the multicast message will be discarded to the discard queue associatedwith the enqueue message source identifier (field 623 of the enqueuedata message). Otherwise, the decision to discard a multicast descriptoris made independently by enqueue processor 301 for each destinationtraffic queue in the multicast group.

Enqueue processor 301 does not process multicast enqueue messages thatare speculatively enqueued until the associated commit enqueue messageis received. Thus, a speculatively enqueued multicast message will blockall subsequent multicast enqueue messages until the associated commitenqueue message is received. This blocking is required to maintaindequeue packet descriptor ordering.

One use for multicast replication is in a system 201 where DCP 202 isdriving a time-division multiplexed, channelized interface device thatdoes not itself support multicast elaboration. Multicast replication canbe used to transmit one copy of a packet for each destination channel.

Details of Descriptor Discard Operations

As already set forth, before enqueue processor 301 provides a descriptorto traffic queue processor 305 to be linked into a traffic queue,enqueue processor 301 determines whether the packet represented by thedescriptor is to be discarded or tagged in order to avoid congestion,manage existing congestion, or recover from past congestion.

Discard and Tagging Operations

The techniques used by enqueue processor 301 to determine whether thereis congestion include buffer thresholding, random early detection, andpolicing algorithms. What technique enqueue processor 301 uses for aparticular traffic queue is determined by the traffic queue's discardconfiguration block 431. Congestion is dealt with as follows:

1. Selecting packet descriptors for discard in order to recover fromperiods of congestion.

2. Selecting non-conforming packet descriptors for discard to avoidcongestion.

3. Tagging non-conforming packet descriptors, so that non-conformingpackets can be selectively discarded by a downstream network elementthat is trying to avoid becoming congested.

4. Marking packet descriptors that have experienced congestion, so thatdownstream network elements can notify the originating traffic sourcesto slow down.

Buffer Pools and Parent Buffer Pools: FIG. 4

The buffer pool information that enqueue processor 301 uses determinewhether a packet should be discarded is kept in buffer pool and parentbuffer pool data structures. These structures are shown in FIG. 4. Foreach buffer pool, buffer pool specification 433(i) indicates a minimumthreshold, a maximum threshold, and a minimum threshold for the bufferpool's parent. These values in a buffer pool 433(j) used by a trafficqueue 204(i) are used by enqueue processor 301 to decide whether todiscard a descriptor intended for traffic queue 204(i). Buffer poolspecification 433 and parent buffer pool specification 435 are updatedeach time a TMC descriptor 216 is enqueued in traffic queue 204 ordequeued from traffic queue 204.

Discard Traffic Queues

Descriptors from all discard operations performed in traffic managementcoprocessor 203 go to one of 32 discard traffic queues 251 maintained byTMC 203. Discard traffic queues are scheduled like non-discard trafficqueues. The scheduler hierarchy is commonly configured such the outputsof schedulers for discard queues go to virtual output ports dedicated tothe servicing of discard traffic. These virtual output ports thus arenot blocked when outbound packet traffic backs up, causing the virtualoutput ports 251 associated with the descriptors representing theoutbound traffic packets to block scheduling of those descriptors. Thepacket lengths associated with discarded packet descriptors are not usedin scheduler bandwidth calculations, because the time required by DCP202 for processing discarded packet descriptors is independent of packetlength. Instead, a configurable packet length ranging from 0 to 255bytes is assigned to discard queue descriptors for scheduling purposes.

The destination discard queue for a discarded packet descriptor ischosen from one of the following sources, listed in priority order:

1. A discard queue identifier can optionally be specified in a trafficqueue's discard configuration block 431.

2. If not specified by the traffic queue discard configuration, TMC 203obtains the discard queue identifier from a table that relates sourcesof TMC descriptors 216 to discard queues. The identifier for the sourceof a TMC descriptor is obtained from field 603.

3. If not specified by the previous two sources, the discard queueidentifier is specified in the traffic queue's class scheduler 503.

Overview of Kinds of Discard Algorithms

A preferred embodiment provides a number of different discardalgorithms; overviews are provided here; a detailed example for one ofthe algorithms will be given later. There is a different format fordiscard configuration block 431 for each of the different discardalgorithms.

Thresholding

Thresholding is used for selectively discarding packet descriptors basedon buffer pool and parent buffer pool sizes under the followingconditions:

1. If the traffic queue's associated buffer pool size is less than theminimum threshold, do not discard the descriptor;

2. If the traffic queue's associated buffer pool size is greater thanthe maximum threshold, discard the descriptor; or

3. If the buffer pool size is between the minimum and maximum thresholdsand the parent buffer pool's size is greater than the parent buffer poolthreshold specified by the traffic queue's selected discardconfiguration data, select the packet descriptor for discard; otherwisedo not discard the descriptor.

Random Early Detection (RED)

Buffer pools can be configured to use random early detection (RED) forselective discard of packet descriptors associated with adaptive trafficsources. The implementation of RED used in the preferred embodiment isbased on the following reference:

Floyd, Sally, and Jacobson, Van, “Random Early Detection for CongestionAvoidance,” IEEE/ACM Transactions on Networking, August 1993.

The RED algorithm calculates a probability of random discard thatdepends on the exponentially weighted average buffer pool size and aminimum and maximum average buffer pool size threshold. Average bufferpool size is used instead of instantaneous size so that temporary burstsof traffic are not unnecessarily discarded. When RED is used with IPpackets, the value of discard priority field 625 of enqueue message 601can be used to select different RED threshold and probability parametersbased on a precedence specified for the IP packet.

Policing

Rate policing is used per traffic queue to identify traffic queues whosepackets are being received at a rate higher than the traffic queue'sallocated or guaranteed transmission rate. Rate policing ensures that atraffic queue using more than its guaranteed rate does not adverselyaffect the guaranteed rates of other complying traffic queues. Ratepolicing can be used in conjunction with buffer pool and parent bufferpool thresholding algorithms.

Rate policing parameters include one or two sets of leaky bucketparameters: maximum sustainable rate and burst tolerance and/or maximumpeak rate and delay variation tolerance. The leaky bucket conformancedefinitions are as defined by the ATM Forum™ 4.0 specification, extendedto support variable length packets, as well as fixed length packets. Theleaky buckets implemented in the TMC policing function can be configuredto support all six of the ATM Forum™ 4.0 conformance definitions. Theleaky buckets are another example of TMC 203's use of models ofconditions outside the TMC.

Each rate policing traffic queue maintains one or two credit bucketstates for enforcing rate and tolerance. When a traffic queue isinitialized, each bucket is credited with its full tolerance. A creditbucket loses one byte credit for each enqueued packet byte and gainsbyte credits at its configured byte rate. An enqueued packet's bytecount comes from the packet byte length field of its associated enqueuemessage, which is received through the traffic management interface.

The ATM Forum™ 4.0 conformance definitions define the action to betaken, discard or tag, when a leaky credit bucket does not have enoughbyte credit to accommodate an enqueued packet byte length. For example,when a peak rate leaky bucket does not have enough credit to accommodatea packet, the associated packet descriptor is always selected fordiscard. When a sustainable rate bucket does not have enough credit toaccommodate a packet, the packet descriptor is either tagged or selectedfor discard depending on the conformance definition.

Message Discard Modes

When a message is carried in a sequence of fixed-length packets, eachpacket will have its own descriptor. In such sequences of fixed-lengthpackets, the header of the last packet has an end-of-message (eom) flagset to indicate the packet is carrying the end of the message. There isno corresponding start-of-message flag; instead, the packet that startsthe next message is identified by the fact that it follows immediatelyafter a packet whose eom flag is set. TMC descriptors 216 representingfixed length packets have an end-of message flag which is set when thedescriptor represents the last packet in the message. The EOM flag is infield 613 of the TMC descriptor. A descriptor for the start of a messageis similarly identified by the fact that it follows immediately after adescriptor that has its EOM flag set.

In systems that use sequences of packets to carry a message, it isassumed that if any one of the packet descriptors that make up a messageis discarded, the entire message cannot be reconstructed and all of thepackets belonging to the message should be discarded. For this reason,performance can be improved if discard of the remaining packets in themessage can begin immediately when a first discard has occurred. Achallenge in doing this kind of discard in the context of look-asidedata stream processing is making sure that the QMU descriptor 2508corresponding to the first packet to be discarded in the message has itseom flag set, so that the channel processor processing the packetcorresponding to the descriptor can properly mark the packet andrecognize the QMU descriptor for the first packet of the next message.

Traffic management co-processor 203 can operate in four differentmessages discard modes:

non-message discard mode,

early packet discard mode,

partial packet discard mode, and

modified partial packet discard mode.

Discard modes are configured on a per-traffic queue basis. Each trafficqueue may employ a number of discard modes. The discard modes arespecified for the traffic queue in discard configuration blocks 433, andwhich discard mode of those available to a given traffic queue is to beused for a packet represented by a given descriptor in the traffic queueis specified by a field in the descriptor. Any of the modes may employany of the techniques for deciding whether a discard is necessary.

In non-message discard mode, the end of message indicator plays no rolein determining how to discard the remaining packets of a message.

In Early Packet Discard mode, the decision to accept or discard a largermessage is done when the descriptor for the first packet of the messageis received. When the first descriptor is discarded, so are all of theremaining descriptors for the packet's message and vice-versa. If thereis more than one packet in the message, the first descriptor will nothave its EOM flag set. To discard the remaining descriptors, enqueueprocessor 301 sets flags in traffic queue state field 861 to indicatethat a descriptor for a packet belonging to a multi-packet message hasbeen discarded and the descriptor with its EOM flag set has not yet beenreceived. As each descriptor for a packet of the message comes in,enqueue processor 301 checks field 613 for the end of message flag. Ifnone is set, the descriptor is discarded; if the EOM flag in field 613is set, enqueue processor 301 discards the descriptor and sets the flagsin traffic queue state field 861 to indicate that a descriptor with anEOM flag has been received. To increase the chances that an entiremulti-packet message can be handled, enqueue processor 301 may discardthe first packet unless the buffer pool and parent buffer poolspecification indicate that large amounts of buffer space are available.

Partial Packet Discard (PPD) mode works like EPD mode if a first packetis discarded. However, it also permits discard decisions to be made on“middle packets” if the first packet was not discarded. When this isdone, the packet on which the decision is made and all of the followingpackets except the last packet are discarded. The last packet cannot be,because it has the EOM flag required to identify the start of the nextmessage. The last packet further contains error detection informationthat will indicate to the ultimate receiver of the shortened messagethat the message is defective.

In the look aside data stream processing context, the decision todiscard a packet is of course made not on the packet itself, but ratheron the TMC descriptor 216 that represents the packet. When enqueueprocessor 301 chooses a descriptor representing a middle packet fordiscard, enqueue processor 301 sets the flags in traffic queue statefield 861 to indicate that a descriptor for a packet in a multi-packetmessage has been discarded and a descriptor with its EOM flag set hasnot yet been received. Enqueue processor 301 then discards descriptorsup to, but not including the descriptor with the EOM flag set and resetsthe flags in field 861 as described above. Not discarding the lastdescriptor guarantees that the message as output from DCP 202 will havea last packet with its EOM flag set. Regardless of the discard modespecified for a traffic queue that is receiving multi-packet messages,enqueue processor 301 uses PPD to discard the rest of the packetsbelonging to a message when there are no longer any buffers in DCP 202for storing further packets of the message. This condition is of courseindicated by the buffer pool and parent buffer pool information for thetraffic queue which is receiving descriptors for the message's packets.

The last message discard mode is Modified Partial Packet (MPP) mode. MPPis a special message discarding policy that is used in conjunction withpacket reassembly. In reassembly, all of the descriptors that correspondto packets that make up a multi-packet message are held in TMC 203 untilthe last packet for the message is received and are then output in aburst to DCP 202, which assembles the packets represented by the burstof descriptors into a single packet. The fact that the packetsrepresented by the burst of descriptors are assembled into a singlepacket in DCP 202 can be taken advantage of to solve a problem of PPD,namely that the truncated message produced by the PPD techniquecontinues to use resources in system 201 and in the remainder of thenetwork until it reaches its destination and is determined to bedefective. The difference between PPD and MPPD is the treatment of thepacket with the EOM flag. In MPPD, the descriptor for the “middlepacket” that is being discarded not only has EOM flag 705 set, but alsotype field 703 set to indicate that it is a discard of a middle packet.The descriptor for the middle packet is then placed in the traffic queue204 in which the message is to be reassembled. The remainder of thedescriptors for the packets of the message, including the last packet ofthe message, are discarded. The descriptors representing the packets forthe partial message are allowed to be scheduled. As will be explained indetail later, the descriptors are output without interleaving to thedescriptor queue 247 specified by the virtual port 251 for the trafficclass scheduler specified by the traffic queue. The channel processorwhich serves the descriptor queue 247 then reassembles the payload fromthe packets represented by the descriptors into the payload of a singlepacket. When the channel processor encounters the descriptor with theEOM flag and the middle packet discard indication, it discards thesingle packet with the reassembled payload.

Detailed Example of Discard: FIGS. 10 and 11

The following detailed example gives details of discard configurationblock 431, buffer pool specification 433, and parent buffer poolspecification 435 and of the operation of enqueue processor 301 for thecase where the modified partial packet discard mode is being employedand the random early discard detection (RED) technique is being used todetermine whether a packet should be discarded.

Detail of Discard Configuration Block 431

FIG. 10 shows the fields of discard configuration block 431 for thiscase. Discard configuration block 431 has two parts: a part 1001 and1019 whose fields are common to all discard configuration blocks and apart 1003 whose fields 1023-1029 are particular to one of the techniquesfor determining when a packet should be discarded. Beginning with thecommon fields of part 1001 and field 10019, the format of the commonpart of parameter block 431 is shown at 1002 in the usual manner, withcolumns 1004-1006 and a row for each field. Beginning with field 1019,this field contains a code that indicates the technique used todetermine whether a packet should be discarded. Here, the code is 011b,indicating that the RED discard technique is being applied.

Field 1017 may contain a tqid 423 for a discard traffic queue that isassociated with discard configuration block 431; when a descriptor isdiscarded as specified in discard configuration block 431, it isdiscarded to the discard traffic queue specified in field 1017. Field1015 indicates whether there is in fact a valid tqid in field 1017.eomControl field 1013 contains a code which specifies which of themessage discard modes is to be employed with the traffic queue. Fields1011-1008 specify threshold values for the buffer pool to which thetraffic queue 204 belongs and for that buffer pool's parent. The bufferpool maximum threshold specified by fields 1010 and 1011 specify themaximum total size of the packets which may be contained in the bufferpool; if adding a new packet to the queue would exceed that limit, thedescriptor for the packet is not added to the traffic queue, but isinstead placed in a discard queue.

The parent buffer pool maximum threshold specified by fields 1008 and1009 specify the amount of packet storage which is available to beshared among the buffer pools that are children of the parent bufferpool; if there is not enough shared storage for the incoming packetrepresented by the descriptor, the descriptor is not added to thetraffic queue, but placed in a discard queue.

Field 1007 contains the part of discard configuration block 431 whosecontents vary with the technique used to detect when a packet must bediscarded. In FIG. 10, these fields are fields 1023-1029 of RED part1003. The RED technique employs a minimum threshold value to determinewhen the technique should be applied; if the total size of the packetsin the traffic queue's buffer pool is less than that after the incomingpacket is added to the traffic queue, the incoming packet will not bediscarded, regardless of the condition of the parent buffer pool. Fields1027 and 1029 contain this minimum threshold value. When the total sizeof the packets in the traffic queue's buffer pool is between the bufferminimum threshold value and the buffer pool maximum threshold value, theRED technique uses the probability term defined in fields 1023 and 1025together with other information stored in the buffer pool specification403 to determine whether the packet should be discarded. Field 1021 isunused in this configuration.

Detail of Buffer Pool Specification 433: FIG. 11

Like discard configuration block 431, buffer pool specification 433 hastwo parts: one, shown at 1102, which is common to all buffer poolspecification, and one, shown at 1103, which is particular to a giventechnique for determining when a packet is to be discarded. Part 1103 inFIG. 11 is the part required for the RED technique. Buffer poolspecification 433 is represented in the same manner as discardconfiguration block 433.

Beginning with the common fields in 1102, 1107 is the field in whichpart 1103 is placed; 1108 contains the instantaneous (i.e. current) sizeof the buffer pool represented by specification 433. The value in thefield is updated to track additions of descriptors to traffic queuesbelonging to the buffer pool or removals of descriptors from thosetraffic queues. In the first case, the size of the packet represented bythe descriptor is added to the buffer pool instantaneous size, and inthe second case, the size of the packet is subtracted from the bufferpool instantaneous size. Fields 1109 and 1110 specify the buffer poolsize below which packets will not be discarded from the traffic queuesbelonging to the buffer pool.

sizeinPacketsNotBytes field 1111 indicates whether the buffer pool sizesare to be specified in terms of number of bytes or number of packets.Parent buffer pool identifier 1113 is the identifier for the bufferpool's parent buffer pool. Discard data configuration type 1115,finally, specifies the discard technique that is to be used by thetraffic queues belonging to the buffer pool. It must specify the sametechnique as does field 1019 in these traffic queues. In field 1115 inthe present example, it specifies the RED discard technique.

1103 shows the fields that are peculiar to the RED discard technique.The RED technique employs the average buffer size in its computations,and field 1117 is the time that value was last updated, while field 1119contains the value itself. Fields 1121-1129 all contain values used inthe RED discard technique. Fields 1101 and 1115 contain the informationfrom common portion 1102 of buffer pool specification 433.

Details of the Discard Operation: FIG. 12

FIG. 12 is a flowchart of how enqueue processor 301 deals withmulti-packet messages when a traffic queue's discard configuration block431 has a type in discardDataType field 1019 indicating that the REDtechnique will be used to determine whether a packet should be discardedand an eomControl field 1013 indicating that the modified PPD form ofpartial packet discard is to be employed. As long as the traffic queueis receiving descriptors for packets in the message, enqueue processor301 executes loop 1205 with regard to the traffic queue.

As previously explained, when enqueue processor 301 is using the MPPDalgorithm to discard packets, it outputs the TMC descriptors 214representing the packets in the message to a non-discard traffic queue204 until one of the TMC descriptors 214 must be discarded. From thispoint on, enqueue processor 301 discards descriptors for the remainingpackets to a discard traffic queue until it receives the descriptor forthe last packet of the message. This descriptor has its EOM flag set,and enqueue processor 301 marks it to indicate an error and outputs itto the non-discard traffic queue that contains the packets of themessages that were not discarded. When a channel processor in DCP 202that is reassembling the payloads of the packets into a single packetencounters the descriptor that has its EOM flag set and is markeddefective, it discards the reassembled packet.

Continuing with details of the implementation of the algorithm in apreferred embodiment shown in flowchart 1201 of FIG. 12 and beginningwith start 1203 and entering loop 1205, enqueue processor 301 first getsthe next descriptor for the message. If traffic queue state fields 837and 853 in the traffic queue's traffic queue parameter block 401indicate that the queue is receiving descriptors for packets of amulti-packet message and that the message is to be discarded (1209), thepacket represented by the descriptor will be added to a discard trafficqueue; to achieve this, branch 1211 is taken; otherwise, branch 1213 istaken to block 1215. The case of a descriptor that is not part of amulti-packet message is not relevant to the present example. In block1215, the size of the packet represented by the next descriptor is addedto the value in BpSize field 1108 of the traffic queue's buffer poolspecification to obtain the new value newBPsz and to the correspondingvalue in parent buffer pool specification 435 to obtain the value newPBPsz. These values are used together with threshold values in discardconfiguration block 431 for the buffer pool and parent buffer pool incase statement 1217 to determine how the descriptor will be treated.

There are three possibilities:

newBPsz is less than the value of the minimum allowance threshold offields 1027 and 1029 of discard configuration block 431; in that case,the packet will not be discarded (branch 1219).

new PBPsz is more than the value of the maximum threshold fields 1008and 1009 for the parent buffer pool in discard configuration block 4310Rnew BPsz is more than the value of the maximum threshold fields for thebuffer pool in discard configuration block 431; in that case, the packetwill be discarded (branch 1223).

Otherwise, the RED technique is used to determine whether the packet isto be discarded (branch 1221). The RED technique uses the probabilityterm information in buffer pool specification 431 to make thedetermination.

With the first possibility, the descriptor is simply added to thenon-discard traffic queue, as shown at 1251. With the third possibility,if the RED technique indicates that the packet is not to be discarded(block 1225), branch 1227 is taken to branch 1219 and the descriptor isadded to the non-discard traffic queue; with the second possibility orif the RED techniques indicates that the packet is to be discarded,branch 1229 is taken, since in both cases, traffic queue state field 836must be set to indicated that this descriptor and following descriptorsare to be discarded. The state is set in block 1231.

With descriptors that are to be discarded, the next step is checkingwhether the descriptor has its EOM flag set (decision block 1233). Whenit does (branch 1237), the MPPD technique requires that the descriptorbe marked as having an error and be placed on the non-discard trafficqueue, which is done at 1239 and 1241. Otherwise, branch 1235 is takenand the descriptor is added to the discard traffic queue. In all cases,the descriptor is then again examined to see whether it is an EOMdescriptor. If not, loop 1205 continues (branch 1245); otherwise, itterminates (branch 1247) and the processing ends (1249).

Speculative Enqueuing: FIG. 13

Speculative enqueuing is a technique which permits a receive processor221 to provide a TMC descriptor 216 to a traffic queue 204 beforereceive processor 221 has received the entire packet that is representedby the descriptor 216. TMC 203 guarantees that the cp descriptor 214contained in the TMC descriptor 216 will not be output to QMU 211 untilafter the entire packet has been either successfully or unsuccessfullyreceived by receive processor 221. The receive processor doesspeculative enqueuing using a pair of enqueue data messages 601. Thefirst enqueue data message contains the TMC descriptor 216 for thepacket and indicates in field 611 that the packet represented by thedescriptor 216 is being speculatively enqueued. When receive processor221 has finished processing the packet, a second enqueue data message,the commit message, follows. Again, field 611 indicates that the messageis a commit message. Only after the commit message has arrived will TMC203 output the cp descriptor 214 contained in the first enqueue datamessage.

Speculative enqueuing is useful for guaranteeing a fixed latency for aTMC descriptor 216 from the start of the reception of the packet itrepresents in a receive processor 221 to being provided to a trafficqueue 204. Such a fixed latency is important to applications running inDCP 202 which distribute processing of packets received from a single,high bandwidth stream of packets (like an OC48c packet stream) among anumber of receive processors 221. With distributed receive packetprocessing, care must be taken to ensure that descriptors are providedto the traffic queues in the same order in which they were received.Within DCP 202, the order is preserved by setting up the receiveprocessors so that they process the packets in strict round-robin orderand output the TMC descriptors 216 for the packets they are processingto QMU 215 in the same strict round-robin order, so that the order ofthe descriptors in the descriptor queues 213 is correct. The fixedlatency between start of packet reception and enqueue in a traffic queue204 provided by the speculative enqueue mechanism decouples receivingthe entire packet from providing the descriptor to TMC 203 and thusenables this strict round-robin processing of descriptors to take placewithout the reduction in receive bandwidth that would occur if a channelprocessor receiving a smaller packet were blocked until a channelprocessor receiving a larger packet had received its entire packet.

Continuing in more detail, in a preferred embodiment, field 623 of thecommit enqueue data message identifies the source of the packet beingspeculatively enqueued, i.e., the receive processor that received thepacket represented by the descriptor. When the entire packet has beenreceived in receive processor 221, receive processor 221 sends thecommit enqueue data message. The commit enqueue data message is shown indetail at 1301 in FIG. 13. Commit enqueue data message 1301 containsonly type field 611 and source identifier field 623. Type identifierfield 611 can be set either to indicate either commit with success,indicating that the packet was correctly received, or commit withfailure, indicating that the packet was not correctly received. Sincethe same receive processor receives the entire packet, source identifierfield 623 in the dequeue data message is set to the same value as in theenqueue data message for the descriptor representing the packet.

When the commit enqueue message comes in, traffic queue processor 305uses the value of source identifier field 623 in the TMC descriptor sentin the commit enqueue message to match the commit enqueue message withthe TMC descriptor 216 from the corresponding speculative enqueuemessage. In a preferred embodiment, the process of matching issimplified by the fact that there are only a small number of receiveprocessors in DCP 202 and the fact that a given source can have only oneoutstanding TMC descriptor 216 from a speculative enqueue message in agiven traffic queue. When the match is made, traffic queue processor 305sets the value of field 611 in the speculatively-enqueued TMC descriptor216 as determined by the value of field 611 in the commit message; ifthe field in the commit message indicates “commit with success”, trafficqueue processor 305 sets the value of field 611 in the speculativeenqueue message to indicate a normal enqueue message; if the fieldindicates “commit with failure”, traffic queue processor 305 sets thevalue of field 611 in the speculative enqueue message to indicate anormal enqueue message with failure. When the modified speculativeenqueue message's descriptor reaches the head of its traffic queue, isscheduled, and is dequeued to queue management unit 211, the dequeuedata message for the descriptor has a value in field 703 whichcorresponds to the value to which field 611 was set by the commitmessage. Queue management unit 211 in a preferred embodiment passesfield 611 on to the channel processor which is processing the descriptorand the channel processor determines what to do if field 611 indicatesthat the speculative enqueue failed. In most cases, of course, thechannel processor will cause the packet to be discarded.

An important aspect of speculative enqueuing is its effect onscheduling. Since the cp descriptor 214 in a speculatively-enqueued TMCdescriptor 216 cannot be output to QMU 211 until the commit message hasbeen received, a traffic queue 204 whose head TMC descriptor 216 is aspeculatively-enqueued descriptor for which no commit message has yetbeen received is ineligible for scheduling. Consequently, when such atraffic queue reaches the head of a scheduler queue 523, traffic queueprocessor 305 removes the traffic queue 204 from the scheduler queue 523before the TMC descriptor 216 is serviced, placing it in the ineligibletraffic queues associated with the traffic queue's traffic classscheduler 503. When traffic queue processor 305 receives the commitmessage that makes the traffic queue 204 eligible, traffic queueprocessor 305 returns the traffic queue 204 to a scheduler queue for thetraffic class scheduler.

Details of Operations Performed by Dequeue Scheduler 303

Dequeue scheduler 303 executes the schedulers in scheduler hierarchy 501and thereby performs TMC 203's scheduling, shaping, and segmenting andreassembly functions. The discussion will begin with a generaldiscussion of the schedulers available in a preferred embodiment of TMC203, will then discuss the scheduling, shaping, and segmenting andreassembly algorithms employed by the schedulers of the preferredembodiment, and will finally provide detailed examples of schedulers andthe manner in which they are implemented and executed.

Schedulers in TMC 203

As already pointed out in overview, dequeue scheduling is done by ascheduling hierarchy 501 that is extensively configurable by users ofTMC 203; in the following, the kinds of schedulers, the ways in whichthey are configured, and the manner in which they operate will all bedescribed in detail.

As shown in the overview, schedulers are classified in hierarchy 501according to their positions in the hierarchy: traffic class schedulers503 are at the leaf nodes and interior schedulers 509 are in theinterior nodes. A scheduler in the preferred embodiment may use thefollowing kinds of scheduling algorithms to select a scheduler queue 523for output from among the scheduler's input scheduler queues 523:

strict priority, in which the output scheduler queue 523 is selectedaccording to a strict priority among the input scheduler queues 523;

round robin;

weighted fair share, where each input scheduler queue is given a weightand the share of bandwidth received by a given input scheduler queue isdetermined by the relationship between the given input scheduler queuesweight and the total weights of all of the input scheduler queues.

frame-based deficit round-robin, which provides weighted fair sharescheduling based on packet byte length; and

grouped weighted fair queuing, which apportions available bandwidthamong input traffic queues whose descriptors represent fixed-sizepackets.

In the preferred embodiment, a traffic class scheduler 503 may beconfigured to use any of the above scheduling algorithms, but aninterior scheduler 509 may be configured to use only the strictpriority, round-robin, or weighted fair share algorithms. Of course,different kinds of schedulers may be employed at different points alongthe path 209 taken by a scheduler queue through hierarchy 501.

Configuring Schedulers: FIG. 14

FIG. 14 shows the resources that are available in a preferred embodimentto a user who is configuring a scheduler. These resources make up whatwill be termed in the following a logical scheduler 1401. A userconfigures a traffic class scheduler or an interior scheduler byselecting among the resources offered by logical scheduler 1401. Theresources include a strict priority scheduler 1407, an excess scheduler1415, and a guaranteed scheduler 1413.

The three schedulers 1413, 1415, and 1407 relate to each other asfollows: guaranteed scheduler 1413 guarantees that a portion of thetotal bandwidth available to be scheduled by scheduler 1401 will beavailable to be shared among the input scheduler queues for logicalscheduler 1401. If the guaranteed portion shares does not completely useup the bandwidth, each of the scheduler queues is further eligible toreceive and use part of the unguaranteed portion of the bandwidth.Excess scheduler 1415 may be used to schedule this unguaranteed portionof the bandwidth. Thus, if a scheduler queue 523 cannot be selected byscheduler 1413 because it has already used its guaranteed bandwidth, thescheduler queue is still eligible to be selected by excess scheduler1415, which schedules the unguaranteed portion of the bandwidth. Output1409 of scheduler 1413 and output 1411 of scheduler 1415 go to strictpriority scheduler 1407, which gives any scheduler queue selected byscheduler 1413 priority over any scheduler queue selected by scheduler1415. The scheduler queue output by logical scheduler 1401 at output1403 is the one selected by scheduler 1407.

Continuing in more detail with possible configurations, in a preferredembodiment, the guaranteed scheduler is always configured as a non-workconserving weighted fair queuing scheduler; a form of weighted fairqueuing scheduler which is of particular interest in the preferredembodiment is the frame-based deficit round robin scheduler. The excessscheduler may be configured as a strict priority scheduler, around-robin scheduler, or a work-conserving weighted fair queuingscheduler. When the guaranteed scheduler is configured as anon-work-conserving weighted fair queuing scheduler, the excessscheduler may be configured as a strict priority scheduler, around-robin scheduler, or a weighted fair queuing scheduler.

Details of the Algorithms Used by Schedulers

Of the algorithms used by schedulers in the preferred embodiment, roundrobin and strict priority need no further explanation; in the following,weighted fair queuing, frame-based deficit round robin, and groupedweighted fair queuing are discussed in more detail.

Weighted Fair Queuing

Weighted fair queuing dynamically applies priorities, or weights, todifferent flows of traffic passing through system 201. Flows of trafficwhich have lower weights get a greater share of the bandwidth availableto all of the flows, and the amount of bandwidth available to a givenflow varies with the current number and weights of the flows. Theadvantage of weighted fair queuing is that traffic such as interactivetraffic which requires immediate transmission can receive lower weights,while traffic which does not require immediate transmission can receivehigher weights. None of the varieties of traffic will block the otherand all will get the type of access they require. In general terms, thefractional amount of service or bandwidth that an input session receiveswhen a weighted fair queuing algorithm is used is equal to thatsession's weight divided by the sum of the weights of all inputsessions. In TMC 203, each of the scheduler's active and schedulableinput scheduler queues 523 represents an input session.

Many papers have been published that define variations of a “weightedfair queuing” algorithm for packet traffic. These variations of aweighted fair queuing algorithm are all derived from the generalizedprocessor sharing (GPS) model and all have different fairnesscharacteristics. The variation of the algorithm used in a preferredembodiment of TMC 203 attempts to achieve the best delay and fairnessproperties with the least complexity.

A weighted fair queuing scheduler in the preferred embodiment may beconfigured as either a work-conserving or a non-work-conservingscheduler. A work conserving scheduler will always service an inputscheduler queue if the scheduler queue is active and schedulable. Thegoal with the work conserving scheduler is to provide perfectinterleaving of scheduler inputs to generate constant rates at which thescheduler's input scheduler queues are serviced with minimal burstiness.The work conserving scheduler assumes that the rate at which a schedulermay output a scheduler queue may be variable, and thus the systempotential or virtual time function used in the preferred embodiment'sweighted fair queuing algorithm does not advance at the rate of realtime, but instead advances by the amount of service provided. In anon-work-conserving scheduler, the input scheduler queue is not serviceduntil a particular moment in real time has occurred. Until that momentoccurs, the traffic queue that will be the next to receive serviceremains at the head of the scheduler queue, unless it is removed becauseit has become ineligible.

Frame-Based Deficit Round Robin

The frame-based deficit round robin scheduling algorithm is used fortraffic streams consisting of variable-length packets. It providesweighted fair share apportioning of available service bandwidth amongtraffic queues that typically don't require bandwidth guarantees or havestrict jitter and delay requirements. The algorithm is particularlyuseful for TCP traffic, which typically consists of a mixture of longmessage packets and much shorter acknowledgement packets.

In the preferred embodiment, the algorithm is employed in a trafficclass scheduler 503. A frame-based deficit round robin traffic classscheduler has three input scheduler queues: one is termed the highpriority scheduler queue; the other two are termed the current schedulerqueue and the next scheduler queue. The traffic class scheduler 503schedules only the high-priority scheduler queue and the currentscheduler queue, with the high-priority scheduler queue having priorityover the current scheduler queue. Scheduler 503 schedules the currentscheduler queue until it becomes empty; at that point, it swaps thecurrent scheduler queue and the next scheduler queue. Traffic queuesthat become eligible are added to the next scheduler queue and trafficqueues that have received their share of service over a time intervalare removed from the current scheduler queue or the high priorityscheduler queue and added to the next scheduler queue. Traffic queuesthat become ineligible are removed from the high priority or currentscheduler queue.

The FBDRR algorithm moves traffic queues between the high priorityscheduler queue and from both of those scheduler queues to the nextscheduler queue. The traffic queues are moved according to two trafficqueue parameters in the FBDRR scheduler and two counter values in eachtraffic queue. The parameters are the following:

a maximum quantum which specifies the maximum amount of service thetraffic queue may receive before it is moved from the high priorityscheduler queue or the current scheduler queue to the next schedulerqueue and

a minimum quantum, which specifies the amount of service the trafficqueue will receive before it is moved from the high priority queue tothe current scheduler queue.

The counters are a deficit counter and a BytesServedThisRoundCounte-r.The values are stored in scheduler state field 845 in the trafficqueue's parameter block 403.

When the scheduler begins scheduling the current scheduler queue, thedeficit counter for each traffic queue in the current scheduler queue isset to the current value of the deficit counter plus maximum quantum andthe BytesServedThisRoundCounter for the traffic queue is set to 0. Eachtime a given traffic queue reaches the head of the current schedulerqueue or the high priority queue, the packet length specified in thehead descriptor is subtracted from the current value of the deficitcounter and the packet length is added to theBytesServedThisRoundCounter. There are three results of interest:

If the result of the subtraction is positive and the result of theaddition is less than minimum quantum and the given traffic queue is notalready in the high priority scheduler queue, the given traffic queue ismoved from the current scheduler queue to the high priority schedulerqueue.

If the result of the subtraction is positive and the result of theaddition is more than minimum quantum, the traffic queue remains in thecurrent scheduler queue if it is already there; otherwise, it is movedto the tail of the current scheduler queue; in either case,BytesServedThisRound is set to 0.

If the result of the subtraction is negative, the given traffic queue isremoved from the current scheduler queue or the high priority queue andplaced in the next scheduler queue. When this is done, deficit counteris set to deficit counter plus maximum quantum and BytesServedThisRoundis set to 0. Adding deficit counter to maximum quantum gives the trafficqueue the opportunity to receive the service in the next round that itcould not receive in this round.

The high priority scheduler queue and the rules for placing trafficqueues on and removing them from the high priority scheduler ensure thattraffic queues whose head descriptors represent packets that are smallerthan the minimum quantum parameter get priority service. This in turnensures that descriptors for TCP acknowledgement packets are quicklyscheduled. Another version of the FBDRR algorithm requires only thecurrent scheduler queue and the next scheduler queue. In this version, atraffic queue that would have satisfied the conditions for being movedto the high priority scheduler queue simply remains at the head of thecurrent scheduler queue until it satisfies the conditions for beingmoved to the next scheduler queue.

Grouped Weighted Fair Queuing

A traffic class scheduler may employ a grouped weighted fair queuingalgorithm. This algorithm is similar to the weighted fair queuingalgorithm but has been modified for apportioning service bandwidth amonggroups of traffic queues that have a common service weight and packetservice interval. This algorithm allocates a weighted fair share pertraffic queue, as opposed to a weighted fair share per input schedulerqueue.

The grouped weighted fair queuing scheduler functions as follows:

1. All traffic queues assigned to the same input scheduler queue sharethe same service weight and the same packet service interval. In otherwords, the scheduler supports a fixed set of weights, one weight for allthe traffic queues in each input scheduler queue, and it is assumed thatall traffic queues belonging to the same input scheduler queue carrypackets of the same size. 2. The scheduler guarantees a weighted fairshare for each eligible traffic queue, but a traffic queue's guaranteedbound on worst-case initial latency can be affected by the number ofeligible traffic queues in that traffic queue's scheduler queue. Thisscheduling algorithm is useful for guaranteeing bandwidth orapportioning available bandwidth among traffic queues that carry fixedsize packets, such as ATM cells.

Details of Shaping

Shaping in TMC 203 is defined as the mechanism used to delay dequeuingof packet descriptors from traffic queues or aggregations of trafficqueues to achieve desired dequeue transmission rate characteristics. InTMC 203, shaping is implemented in schedulers that use non-workconserving weighted fair queuing algorithms. Such schedulers can beconfigured to delay service to an active traffic stream so that thetraffic stream's dequeue service rate is no greater than a specifiedmaximum rate over a given time period. With all shaped scheduling,short-term dequeue rates are likely to be bursty and at times exceed thedesired rate limit, due to the jitter and delay introduced by themultiplexing of large numbers of active scheduler inputs.

Configuring Schedulers for Shaping

A number of techniques can be used to configure logical scheduler 1401for shaping. The basis for all of them is configuring guaranteedscheduler 1413 as a non-work-conserving scheduler and allocating nobandwidth to excess scheduler 1415. In particular, when a groupedweighted fair queuing algorithm is used in guaranteed scheduler 1413,

each traffic queue input is shaped to the rate specified by the weightof the input scheduler queue to which the traffic queue belongs.

when the traffic class scheduler is scheduling variable-length packettraffic, the traffic queues carrying the traffic can be individuallyshaped by configuring the traffic class scheduler as a weighted fairqueuing scheduler and limiting each input scheduler queue to a singletraffic queue carrying variable packet length traffic.

Shaping Using Dual Leaky Buckets

Dual leaky bucket scheduling in the Q5 is limited to scheduling fixedlength traffic in a manner that restricts the dequeuing to both a peakrate in the short term, and a sustained rate over some longer term. Itis supported through pairs of scheduler queues 523 connected to anon-work-conserving-weighted-fair-queuing traffic class scheduler 503operating in grouped mode. The even numbered scheduler queue of eachpair should be configured to output packets at the desired primary rate.The odd numbered scheduler queue should be configured to output packetsat the sustained rate. When a traffic queue needs to be added to ascheduler queue, a sustained rate leaky bucket algorithm is used todetermine whether, if the packet were transmitted now, it would violatethe sustained rate leaky bucket. The state information for the sustainedrate leaky bucket is saved on a per traffic queue basis in the trafficqueue's parameter block 403 in police2 field 816. For this reason,traffic queues 504 for which the discard policy is dual policing cannotspecify schedulers that schedule according to the dual shapingalgorithm. The traffic queue 504 must further specify dual shaping inits scheduler input configuration 3011 (FIG. 30) and must selectappropriate constants in the input configuration. The constants mustdefine which pair of scheduler inputs are being used, the leaky bucketperiod measured in packets, and the leaky bucket limit.

When a traffic queue 204 initially becomes eligible, it will placed onthe scheduler queue configured at the primary rate, and leaky bucketstate information will be saved in the traffic queue's police2 field816. The traffic class scheduler will return schedule state informationwhen the descriptor is served that will be stored in the traffic queue'sschedule state field 845. The stored value will be passed back to thetraffic class scheduler the next time the traffic queue is at the headof its scheduler queue. The schedule state information contains anenable time that will prevent the traffic queue from being served untilthe appropriate time for that rate.

Every time a traffic queue becomes eligible and is added to a schedulerqueue, the leaky bucket state in the police2 field is investigated todetermine if servicing the packet represented by the descriptor at thehead of the traffic queue now would violate the sustained rate leakybucket. If it would violate the rate, the packet's descriptor is placedon the sustained rate scheduler queue instead of the primary rate queue.Additionally, an eligible time value is set in the traffic queue'sparameter block 403 that prevents the traffic queue from being servicedbefore the eligible time is reached. When the eligible time is reachedand the traffic queue is serviced, the traffic queue (if still eligible)will be returned to the end of the sustained rate queue.

Segmentation and Reassembly

System 201 can transform a message carried in a long packet into amessage carried in a sequence of short packets and a message carried ina sequence of short packets into a message carried in a long packet. Thefirst of these transformations is called segmentation and the second iscalled reassembly. An example is an IP packet that is carried as thepayload of a sequence of ATM packets. In segmentation, the IP packet issegmented into the payloads of the sequence of ATM packets; inreassembly, the payloads of the sequence of ATM packets are reassembledinto the IP packet.

In system 201, both segmentation and reassembly involve operations on cpdescriptors 214. In the case of segmentation, a single descriptor 214for the long packet becomes a sequence of descriptors for the shortpackets; in the case of reassembly, a sequence of descriptors 214 forthe short packets becomes a single descriptor 214 for the long packet.In the preferred embodiment, both of these operations involve trafficqueues in TMC 203 and are done in traffic class schedulers 503. Atraffic class scheduler used for segmentation is termed a segmentingscheduler and one used for reassembly is termed a reassemblingscheduler. In the preferred embodiment, the user can configure a trafficclass scheduler to be a segmenting or reassembling scheduler. Trafficqueues that are configured to specify segmenting or reassemblingschedulers are further termed segmenting or reassembling traffic queuesrespectively. With segmentation, parameter values used in thesegmentation are specified when the segmenting scheduler is configured;with reassembly, parameters for the reassembly operation are specifiedwhen the reassembling traffic queue is configured.

Details of Segmentation

With a segmenting traffic queue, a single TMC descriptor 216 that hasreached the head of the segmenting traffic queue will cause a sequenceof QMU descriptors 2508 to be generated. Each QMU descriptor in thesequence will contain a copy of the enqueued descriptor and a progressindicator (field 715) that allows the channel processor in DCP 202 thatis transmitting the packets corresponding to the QMU descriptors in thesequence to be able to determine which bytes of the payload of thepacket represented by the single TMC descriptor from which the sequenceof QMU descriptors is generated need to be fetched to form the packetrepresented by each QMU descriptor in the sequence.

The number of QMU descriptors in the sequence and the value of theprogress indicator in each of the QMU descriptors are determined usingthe following information:

info field 836 in the traffic queue's traffic queue parameter block 403;in a reassembling traffic queue, the value of this field is the lengthof the packet represented by the descriptor presently at the head of thetraffic queue;

a segment size field in the segmenting scheduler; the value of thisfield is the total size of each packet in the sequence;

a payload size field in the segmenting scheduler; the value of thisfield is the maximum size of the payload in each packet of the sequence;and

an overhead size field in the segmenting scheduler; the value of thisfield is the difference between the sizes specified in the segment sizefield and the payload size field.

All sizes are measured in bytes.

The number of dequeue data messages which the segmenting schedulergenerates from an enqueue message for a descriptor representing a singlevariable length packet is calculated as follows:

number of segments=ceiling((packet length+segmentation overheadsize)/segment payload size)

Each dequeue data message 701 belonging to the sequence includes apacket byte remainder value in field 715 that which indicates how muchof the payload of the packet being segmented remained before thisdescriptor of the segment was produced.

To provide an example: the descriptor at the head of the segmentingtraffic queue represents a packet with a total length of 157 bytes; itwill be segmented into a sequence of fixed-length packets, each of whichhas a total length of 60 bytes, of which 48 is payload. The result ofthe segmentation is the following sequence of 60-byte packets:

Packet No. Payload bytes in packet Remainder 1  0-47 157 2 48-95 109 3 96-143 61 4 144-157 13

In this example, the channel processor in DCP 202 which is receiving theQMU descriptors 2508 from produced by the segmenting scheduler isprogrammed to produce 60-byte packets with the appropriate headers andtrailers. Using the remainder value from the QMU descriptor and thelength of the original packet (contained in the QMU descriptor's cpdescriptor 214), the channel processor can determine which bytes of theoriginal packet's payload need to be fetched from buffer management unit227 to be incorporated into the 48-byte payload of each 60-byte packetand whether a given 60-byte packet is the first packet in the sequencecontaining the original packet's payload, a middle packet, or the finalpacket.

As may be seen from the fact that segmentation is performed by thetraffic class scheduler, the decision to discard a packet is unaffectedby whether its destination is a segmenting traffic queue. With regard toscheduling, the descriptor in each separate dequeue data message isseparately scheduled; consequently, dequeue data messages containing QMUdescriptors for packets in the sequence of packets may be interleavedwith other dequeue data messages. The scheduling mechanisms used fordescriptors made by segmenting traffic queues are the same as for otherdescriptors. The only difference is that the packet length value used toschedule the descriptor is retrieved from the segment size field insteadof from the size specified in the TMC descriptor 216.

Reassembly

Reassembly involves combining the payloads of a sequence of packets toform the payload of a single packet. DCP 202 does the combining. To dothe combination on its own, DCP 202 must maintain various pieces ofstate in order to correctly reconstruct the large packet out of thesequence of smaller packets. TMC 203 minimizes the state required in DCP202 to do combination by organizing the dequeuing of QMU descriptors2508 for the sequence of packets from TMC 203 such that the QMUdescriptors representing the packets required for the large packet areoutput via the virtual output port 521 for the reassembling schedulerwithout being interleaved with other QMU descriptors output via thevirtual output port. The role of the reassembling traffic queue inreassembly is to provide the sequence. A problem with reassembly is theamount of resources in TMC 203 that are tied up in storing descriptorsuntil all of the descriptors in the sequence have been received and thedescriptors can be output. Reassembly as implemented in TMC 203 dealswith this problem in two ways:

employing the modified PPD discard algorithm to discard all of thereceived descriptors in a sequence as soon as one of the descriptors inthe sequence has been discarded; and

employing a timeout mechanism to determine that the flow of packets in asequence has been interrupted; when the interruption is detected, thedescriptors for the sequence are discarded using the modified PPDdiscard algorithm.

When TMC 203 has output the sequence of QMU descriptors 2508 in a singlenon-interleaved burst to the descriptor queue specified by thereassembling scheduler's VOP 251, a channel processor in DCP 202 canprocess the QMU descriptors 2508 to combine the payloads of the sequenceof packets into a single large packet and can provide the TMC descriptor216 for the large packet to TMC 203 in an enqueue data message 601 forscheduling in the usual fashion. When TMC 203 outputs the dequeue datamessage containing the QMU descriptor 2508 for the large packet, thelarge packet is output by another channel processor in DCP 202.Reassembly thus provides a good example of the kinds of complexinteractions between TMC 203 and DCP 202 that are possible in system201.

In the kinds of traffic with which reassembly is employed, the packetsbelonging to the sequence of packets whose payload is to be reassembledinto a larger packet arrive in DCP 202 from their source in a stream oftraffic which has the following characteristics:

packets are received in the order in which they are sent by the source;

the source does not interleave packets belonging to different sequencesof packets; and

packets belonging to sequences sent by different sources may beinterleaved.

The last packet in a sequence is marked as containing the end of themessage.

TMC 203 has been configured such that there is a traffic queuecorresponding to each source of sequences of packets to be reassembledin TMC 203 and the receive processor(s) handling the stream of trafficthat includes the sequences specify the traffic queues corresponding tothe sources in the TMC descriptors 216 that they send to TMC 203. Thus,the traffic queue that is receiving the TMC descriptors 216 for asequence from a given source receives the TMC descriptors in the orderin which they were received in DCP 202, but without any interleaved TMCdescriptors from other sources. The channel processor marks the TMCdescriptor for the last packet in the sequence to indicate that itspacket is an EOM (end of message) packet. The traffic queue thatreceives the descriptors for the packets that are to be reassembled thuscontains one or more non-interleaved sequences of TMC descriptors, eachsequence of descriptors corresponding to a sequence of packets from thesource to which the traffic queue corresponds and representing asequence of packets which has been received in DCP 202 and has not yetbeen reassembled. If the packets belonging to the last sequence ofpackets have not yet all arrived in DCP 202, the last sequence ofdescriptors will not include a descriptor that indicates that its packetis an EOM packet.

A reassembling traffic queue 204 is ineligible for scheduling if the TMCdescriptor 216 at the head of the traffic queue belongs to a sequence ofTMC descriptors 216 which does not yet include a TMC descriptor 216 thatis marked as representing an EOM packet. Like any other ineligibletraffic queue, a reassembling traffic queue that is ineligible when itis to be serviced is removed from the scheduler queue. When the EOMdescriptor arrives, traffic queue processor 305 again places the trafficqueue in a scheduler queue. The state information that traffic queueprocessor 305 uses to determine whether the EOM descriptor for asequence has arrived is contained in field 861 of the traffic queue'sparameter block 403.

When the traffic queue 204 is at the head of the scheduler queue andscheduler hierarchy 501 selects the scheduler queue, the output of thesequence of descriptors at the head of the traffic queue begins. At thistime, the schedulers in the path 209 taken through the schedulerhierarchy by scheduler queues from the reassembling traffic classscheduler 293 up to the virtual output port are locked, to keep otherscheduler queues that use the same virtual output port from beingscheduled, and the traffic queue remains at the head of its schedulerqueue until all of the descriptors in the sequence have been output.When the descriptor that is marked EOM is output, the locked schedulersare unlocked and the traffic queue is removed from the head of itsscheduler queue. The sequence of descriptors at the head of the trafficqueue is thus output from its traffic queue 204 to the descriptor queue213 in QMU 217 corresponding to the path's virtual output port in theorder in which the sequence of packets to which the sequence ofdescriptors correspond was received in DCP 202. TMC descriptors 216intended for enqueuing in traffic queues belonging to reassemblingschedulers may be discarded in the same fashions as descriptors intendedfor enqueuing in other traffic queues. The discard mode used in apreferred embodiment is the MPPD mode.

A problem with the reassembly technique as just described is detectingdescriptors from a malformed message, i.e., a message that does not havean EOM marker. The sequence of TMC descriptors representing such amessage will never receive a marked last descriptor, and consequently,when the first TMC descriptor in the sequence reaches the head of thetraffic queue, the traffic queue will become ineligible and will remainso forever. Traffic queue processor 305 detects this situation using ageneralized method for tracing inactivity of traffic queues that canassist in locating malformed sequences and releasing their resources.The generalized inactivity tracing is an implementation of the “clocksweep” method. Periodically, field 869 of the traffic queue's parameterblock 403 is marked as having been swept a first time. Any enqueueactivity on the traffic queue will clear the “swept once” indication.When the “clock sweep” passes a traffic queue on the next pass of clocksweeping, field 869 is either remarked as having been swept once if ithad been cleared by enqueue activity since last sweep, or marked ashaving been swept two or more times if it had not been cleared. Anytraffic queue that is marked as having been swept two or more times musthave been idle for at least as long as the periodicity of the sweep.

With a reassembly traffic queue, the generalized clock sweep is used tocause a traffic queue to “timeout” a reassembly in progress after field869 has been marked as having been swept twice. When a timeout happens,field 861 is set to indicate that the traffic queue is disabled and thetraffic queue is placed in an active scheduling queue. The sequence ofdescriptors for the malformed message is dequeued from TMC 203 asdescribed above, but when the final packet of the malformed sequence isdequeued, the fact that field 861 has been set to indicate that thetraffic queue is disabled causes dequeue scheduler 303 to mark the finalpacket with a special EOM indicator that indicates that the sequenceterminated early and that the traffic queue has been disabled. When thechannel processor in DCP 202 that is receiving the descriptors for thepayloads to be reassembled receives the descriptor with the EOMindicating a malformed message, the channel processor discards thepayloads corresponding to the descriptors. As a consequence of the needto maintain per-traffic queue state for reassembly, reassembling trafficclass schedulers may not use scheduling algorithms that also requireper-traffic queue state for scheduling. In the preferred embodiment, theframe-based deficit round-robin and grouped weighted fair queuingalgorithms require per-traffic queue state for scheduling.

Details of the Implementation of Schedulers

In a preferred embodiment, schedulers are implemented in schedulermemory 1515 internal to TMC IC 1503 and are configured by settingscheduler state in memory 1515. Each scheduler is referred to by itslevel in scheduler hierarchy 501 and its number in the level, and agiven input to a scheduler is referred to by the scheduler's level,number in the level, and number of the input. In a preferred embodiment,each level has a range of values which can be used to specify schedulerinputs at that level, the scheduler's number is an offset in the range,and the inputs belonging to the scheduler are the inputs between theoffset and (number of the scheduler's inputs—1). An input may belong toonly one scheduler. In a preferred embodiment, 32 inputs are availableto the single level 0 scheduler, 512 inputs are available to level 1schedulers, 4K inputs are available to level 2 schedulers, and 8K inputsare available to level 3 schedulers. As previously mentioned, the leavesof the scheduler hierarchy are always traffic class schedulers 503 andthe interior nodes interior schedulers 509.

Details of traffic Class Schedulers 503: FIG. 21

FIG. 21 shows the information which defines a particular traffic classscheduler 503(i)'s position in hierarchy 501 and its behavior in apreferred embodiment. Since traffic class scheduler 503(i) is a leaf inthe hierarchy, its set of input scheduler queues is a set 531 of activescheduler queues 523 whose traffic queues 204 specify traffic classscheduler 503(i). For each of its inputs 2101, traffic class scheduler503(i) maintains input state 2103 for the scheduler queue 523 associatedwith input 2101. The input state 2103(i) for a given input 2101(i)includes whether the input is backlogged (field 2105), i.e., whether theinput's associated scheduler queue 523(j) is active, algorithm-dependentinput state 2106, and the identifiers 2107 and 2109 of the head trafficqueue and the tail traffic queue in the scheduler queue 523 associatedwith the input 2101 Algorithm-dependent input state 2106 is stateconcerning the input scheduler queue that varies according to thescheduling algorithm used by the scheduler.

The place of traffic class scheduler 503(i) in hierarchy 501 isspecified by connection state 2121, which defines the interior scheduler509 and input thereof to which scheduler 503(i) outputs the backloggedscheduler queue 523 selected by scheduler 503(i). That interiorscheduler is termed the parent of scheduler 503(i). Connection state2121 includes the level 2123 in hierarchy 501 to which the parentbelongs, the number 2125 of the scheduler in that level, and the input2127 of the parent to which scheduler 503(i) is outputting the schedulerqueue that it selects.

How traffic class scheduler 503(i) schedules the scheduler queuesassociated with its inputs is determined by scheduler state 2111.Scheduler type 2113 specifies the scheduler type, and consequently thealgorithm used by the traffic class scheduler, as well as whether it isa segmenting or reassembling scheduler; number of inputs 2115 specifiesthe number of inputs 2101 belonging to the traffic class scheduler;locked? 2117 is used to lock scheduler 503(i) while a reassemblingscheduler 503 whose path through hierarchy 501 includes the same virtualoutput port 521 as scheduler 503(i) is outputting a sequence ofdescriptors. The contents of algorithm-dependent state 2119 depends onthe scheduler type specified at 2113 and includes the information neededto configure the scheduler type and state needed to execute itsscheduling algorithm.

Details of Interior Schedulers 509: FIG. 22

FIG. 22 is a detailed block diagram of an interior scheduler 509(i).Connection state 2121 and scheduler state 2111 are the same for interiorscheduler 509(i) as for a traffic class scheduler 503. The functionaldifference between interior scheduler 509(i) and a traffic classscheduler 503 is that interior scheduler 509(i) is an interior node ofscheduler hierarchy 501, and consequently, interior scheduler 509(i)schedules a set 534 of scheduler queues whose membership is determinedby the activities of schedulers that are below scheduler 509(i) inhierarchy 501. This functional difference is reflected in input state2205, which contains information that permits scheduler 509(i) to locatethe scheduler queue 523 which is currently bound to the input and todetermine whether that scheduler queue is not only active, but alsoschedulable.

Input state 2205 for input 2203(0) is shown in detail at 2205(0). Field2105 indicates whether selected scheduler queue 2201(i) is active andschedulable. Field 2106 contains algorithm-dependent input state, asdescribed with regard to FIG. 21. Fields 2207-2209 contain informationabout scheduler queue 2201(i) that is propagated from the schedulerqueue's traffic class scheduler 503. Source scheduler field 2207 andsource scheduler input field 2209 permit location of the head and tailpointers for the scheduler queue; propagated eligible time 2211indicates the time at which scheduler queue 2201 is next eligible to bescheduled in non-work-conserving scheduling algorithms.

Fields 2213-2217 contain information about any virtual output port521(k) that is on the path between scheduler 509(i) and the trafficclass scheduler 503 which is the source of scheduler queue 2201(i).Field 2213 indicates whether there is such a virtual output port; ifthere is such a virtual output port, field 2215 indicates whether thedescriptor queue 213 corresponding to virtual output port 521(k) cantake further descriptors, and thus whether scheduler queue 2201(i) isschedulable. VOP specifier field 2217 contains the identifier for thevirtual output port; when a QMU descriptor 2508 is output from TMC 203,this field in the scheduler 509 at level 0 is the source of the VOPidentifier specified in field 707 of QMU descriptor 2508.

Details of Virtual Output Ports: FIG. 27

FIG. 27 shows the data structured employed in a preferred embodiment toimplement a virtual output port 521(i). Field 2701 contains the currentcredits available to virtual output port 521(i), that is, the number ofdescriptors which may currently be added to the descriptor queue 213corresponding to virtual output port 521(i). Field 2701 is configuredwith a maximum dequeue credit that is calculated to ensure that thevirtual output port's full bandwidth can be maintained, given theround-trip latency of the dequeue/dequeue acknowledge loop. Whenever TMC203 outputs a descriptor from a traffic queue belonging to a schedulerqueue whose path 529 through scheduler hierarchy 501 includes virtualoutput port 521(i), the value of field 2701 is decremented; whenever QMU217 sends TMC 203 a dequeue data message acknowledgement 1921 indicatingthat a descriptor has been removed from the descriptor queue 213corresponding to virtual output port 521(i), the value of field 2701 isincremented. The mechanism for passing these messages will be describedlater. When current credit field 2701 has the value 0, none of thescheduler queues whose paths 529 pass through virtual output port 521(i)is schedulable. Field 2703 is an identifier for virtual output port2703; in a preferred embodiment, the identifier is simply the identifierfor descriptor queue 213 corresponding to the virtual output port.Fields 2701 and 2703 are propagated to schedulers 509 that are abovevirtual output port 521(i) in scheduler hierarchy 501, as shown in FIG.22. The fields grouped together at 2705 specify the location of virtualoutput port 521(i) in scheduler hierarchy 501. The location is specifiedby specifying an input to a particular scheduler 509(j). Scheduler509(j) is specified by its level in the hierarchy (field 2707) and itslocation in the level (field 2709), and field 2711 specifies the inputto scheduler 509(j).

Details of Operation of Scheduler Hierarchy 501

Scheduler hierarchy 501 schedules scheduler queues 523 in response toscheduler events that change the state of scheduler hierarchy 501.Whenever such an event occurs, dequeue scheduler 303 first changes thestate of hierarchy 501 as required by the event and then schedules thescheduler queues 523 in the parts of hierarchy 501 affected by thechanges in the state of hierarchy 501. There are three types ofscheduler events:

Scheduler queue enqueue event. A scheduler queue enqueue event occurswhen there is a change in the traffic queue 204 that is at the head of ascheduler queue or in the TMC descriptor 216 at the head of the headtraffic queue.

Scheduler queue dequeue event. A scheduler queue dequeue event occurswhenever scheduler hierarchy 501 has selected a scheduler queue 523 fordequeue.

Virtual output port enable event. A virtual output port enable eventoccurs when the reception of a dequeue acknowledge message 1921 from DCP202 causes a virtual output port's dequeue credit to transition fromzero to non-zero.

Occurrence of a scheduler event causes changes in values in the state ofschedulers and virtual output ports, and when the changes caused by theevent have been made in the values, the schedulers in the path 529affected by the event begin scheduling, starting with the path's trafficclass scheduler 523 and ending with the level 0 scheduler.

State Changes Resulting from Scheduler Events.

Continuing in more detail with the state affected by a scheduler event,a scheduler queue enqueue event can result from a scheduler queuebecoming non-empty and therefore active, from a scheduler queue dequeueoperation causing a new traffic queue to become the head of the inputscheduler queue, or a new descriptor to become the head of the trafficqueue at the head of the input scheduler queue. In the latter case, ifthe new descriptor cannot be dequeued and therefore renders the trafficqueue ineligible, the scheduler queue enqueue event will result in theineligible traffic queue being removed from the scheduler queue. That inturn may render the scheduler queue empty and therefore inactive. Thevalue of backlogged? 2105 will of course change as the scheduler queuebecomes active or inactive as a consequence of the scheduler queueenqueue event.

A dequeue event may cause a traffic queue to become empty, which may inturn render a scheduler queue inactive. That will in turn result in anupdate of the traffic class scheduler 503's backlogged? field 2105 ininput state 2103 for the scheduler queue from which the descriptor wasdequeued. The dequeue event further updates virtual output port enablefields 2215 in the schedulers following the virtual output port alongthe scheduler queue's path 529 through scheduler hierarchy 501. Avirtual output port enable event, finally, also updates virtual outputport enable fields 2215 in the schedulers following the virtual outputport along the scheduler queue's path 529 through scheduler hierarchy501.

Scheduling in Response to a Scheduler Event

After the updates of state in hierarchy 501 that are required by theevent have been made, scheduling begins with the lowest-level schedulerin hierarchy 501 whose state is affected by the event and continues inthe schedulers on path 529 through the hierarchy from the lowest-levelaffected scheduler through the level 0 scheduler. Thus, with schedulerqueue enqueue and dequeue events, scheduling begins with the trafficclass scheduler 503 affected by the event, and with the virtual outputport enable events, scheduling begins with the scheduler whose input iscontrolled by the virtual output port whose state was affected by theevent. At each scheduler on the path, selection of a scheduler queue 523from the set of scheduler queues defined by the scheduler's input ismade according to the following rules:

if the lowest-level scheduler affected by the event is a traffic classscheduler 503, an input scheduler queue cannot be selected by thetraffic class scheduler unless the input scheduler queue is backlogged,as indicated by field 2105.

If the scheduler is a interior scheduler 509 that has an input schedulerqueue that is controlled by a virtual output port, the input schedulerqueue cannot be selected by the scheduler unless virtual output portenable state 2215 indicates that the input scheduler queue isschedulable.

If the scheduler is a interior scheduler 509 and the input schedulerqueue has a value in propagated eligible time field 2211 that is not inthe future, selection among the schedulable input scheduler queues isgoverned by the scheduler's configured scheduling algorithm (example: astrict priority scheduling algorithm would select the lowest numberedactive scheduler input).

if all input scheduler queues have times in field 2211 that are in thefuture, the schedulable input scheduler queue with the nearest eligibletime is selected.

The scheduler queue selected for dequeue to DCP 202 is identified by thepropagated scheduler/input state 2207 and 2209 in input state 2205associated with the input 2203 selected by the level 0 scheduler and thevirtual output port 521 for the path taken by the selected schedulerqueue is identified by propagated virtual output port specifier 2217 ininput state 2205 associated with the input 2203.

Details of Scheduler Configuration: FIGS. 23, 24,29 36 and 37

FIGS. 23 and 36 show scheduler configuration data 2301 which is used toconfigure both traffic class schedulers 503 and interior schedulers 509.Configuration of some kinds of traffic class schedulers requiresadditional traffic class scheduler configuration data 2901, shown inFIG. 29. The data contained in specifier 2301 is used to construct ascheduler configuration specifier 425 for a scheduler. As before, thefigures show tables, with each row of the table representing a field inconfiguration data 2301 or 2901. The uses of the fields are specified inrow 1006. FIG. 23 is for the most part self-explanatory; fields 2303 and2305 specify the level and position in the level of the scheduler, andthereby identify the scheduler being configured; fields 2307 through2311 define how the scheduler is connected to its parent; fields2313-2317 define the scheduler's type in terms of logical scheduler1401; field 2319 defines the number of inputs for the scheduler's input.The number varies with the kind of scheduler. Associated with each of ascheduler's inputs is input configuration data, shown in FIG. 24.

FIG. 29 shows traffic class scheduler configuration data 2901. Field2903 is a tqid 423 for a discard traffic queue associated with thetraffic class scheduler 503 being defined; grouped scheduler type flag2906 indicates whether the scheduler is operating in grouped mode;scheduler type field 2907 indicates whether the scheduler is an FBDRRscheduler; dual shaper flag 2909 indicates that all of the scheduler'sinputs are operating in dual shaping mode. Type field 2911 specifies thetype of traffic queues being scheduled by the scheduler. The fieldindicates whether the traffic queues 204 have varying length or fixedlength packets, and if they have fixed-length packets, whether thescheduler is to segment or reassemble the packets in the traffic queue.When type field 2911 indicates a segmenting traffic queue, fields2913-17 specify the parameters used in segmenting.

FIGS. 24 and 37 show scheduler input initialization data 2401, which isused to initialize the inputs of the schedulers; this data, too, is partof scheduler configuration specifier 425. Again, the figures showtables, with each row representing a field in input initialization data.Fields 2407 and 2409 specify the scheduler to which the input belongs,while field 2411 indicates the number of the input being initialized inthe specified scheduler. Which of the remaining fields are used dependson the type of the scheduler. Fields 2403 and 2405 specify the byteservice interval in scheduler types that use weighted fair queuing;field 2413 is used in guaranteed-excess select schedulers of the typeshown in FIG. 14 to specify how the input is connected to guaranteedscheduler 1413 and excess scheduler 1415.

FIGS. 30, 40, and 41 show the data 3001 used to relate traffic queues toinput scheduler queues 523 for traffic class scheduler 503. For a giventraffic queue, this data is referred to by field 831 in the trafficqueue's parameter block 403. The contents of the data depend on thescheduling algorithm used by the traffic class scheduler. The contentsshown at 3003 are used for all scheduling algorithms where the trafficqueue remains assigned to a single input scheduler queue belonging tothe traffic class scheduler. The data consists of a type flag 3005,which is set to 00, indicating that the algorithm retains the trafficqueue in a fixed scheduler queue, and field 3009, which contains thenumber of the fixed input scheduler queue in the traffic classscheduler. Examples of traffic class schedulers which use data 3003 areround-robin and strict priority schedulers.

Data 3011 is used for dual shaping leaky bucket schedulers, in which atraffic queue is moved between members of a pair of input schedulerqueues. The value of the type field specifies this kind of scheduling,fields 3015 and 3017 contain parameters for the leaky bucket scheduling,and field 3019 specifies the even input scheduler queue of the pair.Data 3021 is used for FBDRR schedulers. Type field 3023 indicates thiswith the value ‘10’, field 3025 is the minimum quantum parameter for thetraffic queue, and field 3027 is the maximum quantum parameter for thetraffic queue. Of course, many different traffic queues 204 may sharedata 3021.

Example Configuration and Operation of a Scheduler that Uses theFrame-Based Deficit Round-Robin Scheduling Algorithm FIG. 26

FIG. 26 shows the detailed configuration of a traffic class scheduler503 that has been configured as a frame-based deficit round-robinscheduler 2601. As previously explained, the FBDRR algorithm schedulesaccording to packet size, and consequently allocates bandwidtheffectively when the traffic consists of variable-sized packets such asthose typical of the TCP protocols. A novel feature of the presentversion of FBDRR is the manner in which it makes provision for the factthat many of the messages in the TCP protocols are relatively shortacknowledgement messages.

In scheduler 2601, connection state 2121 and input state 2103 for eachinput are as previously described. Scheduler type field 2113 has thevalue b111, indicating the deficit round-robin scheduling algorithm, andnumber of inputs 2115 has the value 4, of which three inputs 2103(0 . .. 2) actually have scheduler queues 523 associated with them: In theimplementation of the FBDRR algorithm employed in a preferredembodiment, two of the scheduler queues, in this case, the schedulerqueues 2607 and 2611 attached to inputs 2101(0) and 2101(2) respectivelyalternate as the current scheduler queue 2607 and the next schedulerqueue 2611. When the current scheduler queue is empty, it becomes thenext scheduler queue and the next scheduler queue becomes the currentscheduler queue. The third scheduler queue is high priority queue 2609.Algorithm-dependent state 2119 includes an item of state for each of thethree scheduler queues; item 2601 indicates which of queues 2607 and2611 is the current scheduler queue; item 2605 indicates which is thenext scheduler queue; item 2603 indicates which scheduler queue is highpriority queue 2609. As described in the discussion of the FBDRRalgorithm, which scheduler queue a traffic queue is placed in isdetermined by the traffic queue's maximum quantum and minimum quantumparameters and its deficit counter 2615 and BytesServedThisRound (BSTR)counter 2616. The parameter values are contained in input data 3021(FIG. 30), which is pointed to by field 831 in the traffic queue'sparameter block, as shown at 2613. The counter values are stored infield 845.

How the values of max quantum 2615, min quantum 2613, deficit counter2615 and BSTR counter 2616 relate to which scheduler queue the trafficqueue is in is shown by the expressions at the bottom of each of thetraffic queues. As explained in the discussion of the algorithm, when adescriptor is removed from the traffic queue 204 at the head of eithercurrent scheduler queue 2607 or high priority scheduler queue 2609, thetraffic queue's deficit counter 2615 is decremented by the length of thedescriptor's packet and its BSTR counter 2616 is incremented by thatamount. When a traffic queue is moved from high-priority scheduler queue2609 to current scheduler queue 2607, BSTR 2616 is set to 0; when atraffic queue is moved from either high-priority scheduler queue 2609 orcurrent scheduler queue 2607 to next scheduler queue 2611, the trafficqueue's deficit counter 2615 is set to maximum quantum plus deficitcounter and its BSTR counter 2616 is set to 0. When a traffic queue thatis at the head of current scheduler queue 2607 or high priorityscheduler queue 2609 is or becomes ineligible, it is removed from thescheduler queue; when a traffic queue becomes eligible, it is placed innext scheduler queue 2611.

Physical Implementation of TMC 203: FIGS. 15-20

Overview of the physical implementation: FIG. 15 FIG. 15 is a blockdiagram of physical implementation 1501 of system 201. As indicated inthe discussion of system 201, there are two main components: DCP 202 andTMC 203. As shown here in more detail, TMC 203 includes TMC IC 1503, inwhich are implemented enqueue processor 301, dequeue scheduler 303, andtraffic queue processor 305, together with part of TMC memory 307,including scheduler memory 1515, in which scheduler hierarchy 501 isconfigured, and external memories 1509, 1511, and 1513, which implementthe remainder of TMC memory 307. External memory 1509 is a ZBT SRAMmemory which stores traffic queue parameter blocks 403 and related datastructures for the traffic queues; external memory 1513 is a DDRSDRAMmemory which stores the descriptors in the traffic queues' descriptorqueues 419; external memory 1511 is a ZBT SRAM memory that stores thedata used to link TMC descriptors 216 in the traffic queues 204 and tolink traffic queues into scheduler queues. As will be explained in moredetail in the following, TMC IC 1503 may be configured for varyingamounts of external memory.

TMC IC 1503 receives enqueue data messages 601 from and provides dequeuedata messages 701 to DCP 202 via TMI bus 1507. Both DCP 202 and TMC 203may be configured using PCI bus 1505 to write to TMC memory 307. Bothinternal and external TMC memory 307 may be read and written via PCI bus1505. PCI bus 1505 employs a standard PCI bus protocol; the protocolused in TMI bus 1507 will be explained in more detail in the following.

Details of TMC IC 1503: FIG. 16

FIG. 16 shows internal details of TMC IC 1503. Also included, but notshown, is memory internal to TMC IC 1503. There are an interface 1601 toPCI bus 1505, an interface 1603 to TMI bus 1507, a controller 1605 forparameter memory 1509, a controller 1607 for link memory 1511, and acontroller 1609 for descriptor memory 1513. Also found in TMC IC 1503are dequeue scheduler 303, enqueue processor 301, and traffic queueprocessor 305. The arrows linking the components indicate the flow ofdata between them. Thus, when TMI bus interface 1603 receives an enqueuedata message 601, it outputs enqueue data message 601 to enqueueprocessor 301, which provides at least cp descriptor 214 to descriptormemory controller 1609 for storage in descriptor memory 1513, theremaining contents of TMC descriptor 216, a link to the stored cpdescriptor 214, and a specification of a traffic queue to traffic queueprocessor 305, which uses the information and link memory controller andlink memory 1511 to link the descriptor into the specified traffic queueor discard traffic queue. While this is going on, dequeue scheduler 303executes schedulers contained in the memory of TMC IC 1503 and selectsthereby the traffic queue whose head descriptor is to be next output viaTMI bus interface 1603. Dequeue scheduler 303 uses traffic queueprocessor 305 to retrieve the link to the selected traffic queue's headdescriptor and provides it along with the additional information neededto make a dequeue data message 701 to TMI bus interface 1603, whichprovides the link to controller 1513, receives the descriptor frommemory 1513, and outputs a dequeue data message 701 containing thedescriptor via TMI bus interface 1603.

Memory Configurations with TMC IC 1503: FIGS. 17 and 18

As previously mentioned, TMC IC 1503 may be configured with differentamounts of external memory. FIG. 17 shows a maximum configuration.Descriptor memory 1513 may include up to four 128 Mb(.times.16) and one128 Mb(.times.8) DDRSDRAM memory ICs 1703; link memory 1511 may containup to five 1 Mb(.times.18) ZBT SRAM memory IC's 1705, and descriptorparameter memory 1511 may include up to 4 512K(.times.36) ZBT SRAMmemory IC's. When so configured, TMC IC 1503 will support OC 48 linerates and will be able to handle 2M 32-bit descriptors, 256K trafficqueues, and 8K scheduler queues. Where line rates are lower ordescriptors are fewer or smaller or where fewer traffic queues or fewerscheduler queues are required, the amount of external memory may bereduced. Configuration registers in TMC IC 1503 that are settable viaPCI bus 1505 define both the maximum size of the external memories andpartitions within the external memories. FIG. 18 is a table 1801 whichshows typical configuration possibilities for OC 48 line rates and theamounts of each kind of external memory required for theseconfigurations.

Details of TMI Bus 1507: FIG. 19

FIG. 19 shows a schematic 1901 of TMI bus 1507; table 1925 is a tablethat lists the names of the bus's signal names, whether the signal is aninput or output signal from the point of view of TMC 1503, and adescription of the signal.

Clock Signals

The DQCLK/DQCLKX 1905 pair is derived by TMC IC 1503 from TMICLK source1903. DQCLK is half the frequency of TMICLK. DQCLKX is the inverted formof DQCLK. DQCLKX is exactly 180 degrees out of phase with respect toDQCLK. All outputs of TMC IC 1503 are synchronized to the rising edgesof both DQCLK and DQCLKX; these outputs include DQD[23:0], NQRDY,DQARDY, and DQPAR. The NQCLK/NQCLKX pair 1907 is derived by the DCP fromthe received DQCLK/DQCLKX pair. NQCLKX is exactly 180 degrees out ofphase with respect to NQCLK. All outputs of DCP 202 are synchronized tothe rising edges of both NQCLK and NQCLKX; these outputs includeNQD[23:0], DQRDY, DQACK[1:0], and NQPAR. The maximum clock frequency forthe TMICLK signal is 200 MHz, which implies a maximum frequency of 100MHz for each clock in the DQCLK/DQCLKX and NQCLK/NQCLKX pairs. TheTMICLK frequency and NQD/DQD bus widths are chosen to support 32 bytedescriptors assuming full C-5 DCP port bandwidth (approximately 5 Gbps)and a minimum average packet size of 40 bytes. The TMICLK frequency isfurther restricted to be no greater than twice the frequency of the TMCsystem clock, SCLK, which has a maximum frequency of 133 MHz.

Parity Signals

NQPAR signal 1909 is an odd parity signal covering all outputs of DCP202 received by TMC IC 1503 (including NQD[23:0], DQRDY, andDQACK[1:0]). DQPAR 1911 signal is an odd parity signal covering alloutputs of TMC IC 1503 received by DCP 202 (including DQD[23:0], NQRDY,and DQARDY).

Message Buses

There are three message buses in TMI bus 1507: NQD[23:0] 1913, whichcarries enqueue data messages, DQD[23:0] 1917, which carries dequeuedata messages, and DQACK[1:0] 1921, which carries acknowledgements ofdequeue data messages. NQD[23:0] 1913 carries the 24-bit words ofenqueue data messages. The formats of these messages are shown in detailin FIGS. 6, 31, and 13. The NQD[23:0] bus pins are all high when the busis idle. The start of an enqueue message is identified by a non-idlevalue in type field 611 of the message (bits 2:0 of the first 24-bitword of the message). DQD[23:0] carries the 24-bit words of dequeue datamessages. The formats of the messages are shown in detail in FIGS. 7,32, and 33, and as with enqueue data messages, the start of the dequeuedata message is identified by a non-idle value in type field 703 of themessage (bits 2:0 of the first 24-bit word of the message). The size ofan enqueue or dequeue data message is variable depending on a descriptorsize. The descriptor size is statically configured on both sides of theinterface before any enqueue messages are sent from DCP 202 to TMC IC1503.

DQACK[1:0] carries dequeue acknowledge messages from DCP 202 to TMC IC1503. An acknowledge message is sent each time a descriptor is dequeuedfrom a queue 213 in queues 247. Each message contains the virtual outputport identifier specified in field 707 of the dequeue data message 701in which the dequeued descriptor came from TMC IC 1503. The message ismade up of 5 two-bit words and its format is shown at 2801 in FIG. 28.

Flow Control on TMI Bus 1510: FIGS. 20, 38, 39

Flow of messages over the message buses NQD 1913, DQD 1917, and DQACK1:0 is controlled by the signals NQRDY 1915, DQRDY 1919, and DOARDY 1923respectively. NQRDY signal 1915 must be asserted to enable the flow ofenqueue data messages over the enqueue data bus (NQD[23:0]). Once anenqueue data message is started on the enqueue data bus, it must becompleted. This signal is used by TMC IC 1503 to pace the enqueue datamessages coming from DCP 202. In the extreme case, TMC IC 1503 uses thissignal to stop incoming enqueue data messages entirely when TMC IC 1503has run out of descriptor storage resources. After the deassertion ofNQRDY 1915 by TMC IC 1503, DCP 202 must stop generating enqueue datamessages within a count of 12 rising edges of both NQCLK and NQCLKX.This is shown in timing diagram 2001 in FIG. 20. NQRDY 1915 isdeasserted at 2003 and DCP 202 must stop generating enqueue datamessages by the time indicated by 2005.

Note that the NQRDY signal is synchronous with the DQCLK/DQCLKX clockpair. Rising edges of the NQCLK/NQCLKX pair are counted starting withthe first NQCLK/NQCLKX rising edge after the first rising edge of theDQCLK/DQCLKX pair in which NQRDY is sampled inactive. If theNQCLK/NQCLKX pair is treated as being asynchronous with respect to theDQCLK/DQCLKX pair, then one rising edge of NQCLK/NQCLKX out of therequired 12 is lost due to the asynchronous nature of the clocks.

DQRDY signal 1919 manages flow control of dequeue data messages. DQRDYis asserted to enable the flow of dequeue messages over the dequeue databus (DQD[23:0]). Once a dequeue data message is started on the dequeuedata bus, it must be completed. This signal is used by DCP 202 to pacethe dequeue data messages coming from TMC IC 1503. TMC IC 1503 must stopgenerating dequeue data messages within a count of 6 rising edges ofboth DQCLK and DQCLKX after the deassertion of DQRDY by the DCP, asshown in timing diagram 2007 of FIG. 20, where deassertion of DQRDY 1919occurs at 2009 and 2011 marks the point at which no further new dequeuedata messages may be generated.

Note that DQRDY signal 1919 is synchronous with the NQCLK/NQCLKX clockpair. Rising edges of the DQCLK/DQCLKX pair are counted starting withthe first DQCLK/DQCLKX rising edge after the first rising edge of theNQCLK/NQCLKX pair in which DQRDY is sampled inactive. If theDQCLK/DQCLKX pair is treated as being asynchronous with respect to theNQCLK/NQCLKX pair, then one rising edge of DQCLK/DQCLKX out of therequired 6 is lost, due to the asynchronous nature of the clocks.

DQARDY 1923 is asserted to enable the flow of dequeue acknowledgemessages over dequeue acknowledge bus DQACK 1921. Once a dequeueacknowledge message is started on the dequeue acknowledge bus, it mustbe completed. DQARDY 1923 is used by TMC IC 1503 to pace the dequeueacknowledge messages coming from DCP 202. The DCP must stop generatingdequeue acknowledge messages within a count of 12 rising edges of bothNQCLK and NQCLKX, after the deassertion of DQARDY by TMC IC 1503 asshown in timing diagram 2013 of FIG. 20, where deassertion of DQARDY1919 occurs at 2015 and 2017 marks the point at which no further newdequeue acknowledgment messages may be generated.

Note that DQARDY signal 1023 is synchronous with the DQCLK/DQCLKX clockpair. Rising edges of the NQCLK/NQCLKX pair are counted starting withthe first NQCLK/NQCLKX rising edge after the first rising edge of theDQCLK/DQCLKX pair in which DQARDY is sampled inactive. If theNQCLK/NQCLKX pair is treated as being asynchronous with respect to theDQCLK/DQCLKX pair, then one rising edge of NQCLK/NQCLKX out of therequired 12 is lost due to the asynchronous nature of the clocks.

CONCLUSION

The foregoing Detailed Description has described to those skilled in therelevant technologies how to make and use a stream data processingenvironment in which the inventions of the present patent applicationare implemented and has further disclosed the best mode of implementingthe inventions presently known to the inventors. It will, however, beimmediately apparent to those skilled in the relevant technologies thatthe inventions can be practiced in many stream data processingenvironments other than the one disclosed herein and that even in theenvironment disclosed herein, many alternative embodiments of theinventions are possible.

To give some examples: The inventive techniques described herein areparticularly useful in an environment where the packet processing isdone in one integrated circuit and the traffic management is done inanother, but they are by no means limited to such an environment, butcan be applied wherever it is desirable to separate traffic managementand packet processing, and thus can be used with devices that performtraffic management and/or packet processing functions but are notimplemented as integrated circuits. Further, the form and content of thedescriptors will vary with every implementation, as will the trafficmanagement functions and packet processing functions. Additionally, thediscard and scheduling operations that are performed on descriptors forpackets in the preferred embodiment can also be performed using thepackets themselves. The details of the interface between the trafficmanagement part of the environment and the packet processing part willalso vary from implementation to implementation.

For all of the foregoing reasons, the Detailed Description is to beregarded as being in all respects exemplary and not restrictive, and thebreadth of the invention disclosed here in is to be determined not fromthe Detailed Description, but rather from the claims as interpreted withthe full breadth permitted by the patent laws.

1-40. (canceled)
 41. A method of scheduling varying-length packets, themethod employing two sets of sets of the packets and the methodcomprising the steps of: selecting a given set of packets belonging to acurrent set of the two sets of sets of packets for scheduling, each setof packets belonging to the current set of the sets of packets beingassociated with a maximum quantum and a minimum quantum, the given setof packets remaining selected for scheduling as determined by theminimum quantum, and the minimum quantum determining a total size ofpackets that may be scheduled from the selected set of packets beforeagain selecting a set of the packets belonging to the current set of thesets for scheduling; placing the given set of packets in the other ofthe two sets of sets of the packets as determined by the maximumquantum, the maximum quantum determining a total size of packets thatmay be scheduled from the selected set before the selected set is placedin the other of the two sets of the sets of packets; and when thecurrent set of sets of packets becomes empty, swapping the current setof sets of packets and the other set of sets of packets.
 42. The methodset forth in claim 41 further comprising the step of: when the set ofpackets is moved from the current set to the next set, computing a newmaximum quantum using the difference between the total size of thepackets actually scheduled and the maximum quantum at the time the setof packets is placed in the other of the two sets of packets.
 43. Themethod set forth in claim 41 further comprising the steps of: when a setof the packets belonging to the current set becomes ineligible forscheduling, removing the ineligible set of packets from the current set;and when an ineligible set of packets becomes eligible for scheduling,adding the eligible set to the next set.
 44. The method set forth inclaim 41 wherein: the current set of sets of packets is an ordered setand the sets of packets are selected for scheduling in round-robinfashion.
 45. The method set forth in claim 41 wherein: the sets ofpackets in the current set are ordered sets and when a set of packetshas been selected for scheduling, a packet is selected therefrom inround-robin fashion.
 46. The method set forth in claim 41 wherein: themethod employs a third set of sets of packets that has priority forscheduling over the current set of sets of packets; and the given set ofpackets belongs to the third set of sets of packets while the given setof packets remains selected for scheduling as determined by the minimumquantum and is thereafter moved to the current set of sets of packetsand scheduled therefrom as determined by the maximum quantum.
 47. Themethod set forth in claim 46 wherein: the current set of sets of packetsand the third set of sets of packets are ordered sets and the sets ofpackets are selected for scheduling in the current set of packets and inthe third set of packets in round-robin fashion.
 48. The method setforth in claim 47 wherein: the sets of packets in the current set andthe third set of sets of packets are ordered sets and when a set ofpackets has been selected for scheduling, a packet is selected therefromin round-robin fashion.
 49. The method set forth in claim 41 wherein:each packet is represented by a descriptor; and in the set of packets,the packets are represented by their descriptors.